From 60f21b12b2661c960514b5864e0d78d6a1e3ecd8 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Wed, 21 May 2014 15:51:38 -0700 Subject: [PATCH] Add doc comments explaining some return types --- src/components/main/layout/box_.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/main/layout/box_.rs b/src/components/main/layout/box_.rs index 2e2e1309638..e55a4ed2793 100644 --- a/src/components/main/layout/box_.rs +++ b/src/components/main/layout/box_.rs @@ -1086,7 +1086,11 @@ impl Box { } } - /// Split box which includes new-line character + /// Split box which includes new-line character. + /// + /// A return value of `None` indicates that the box could not be split. + /// Otherwise the split boxes are returned. The right boxe is optional due + /// to the possibility of it being whitespace. pub fn split_by_new_line(&self) -> Option<(Box, Option)> { match self.specific { GenericBox | IframeBox(_) | ImageBox(_) | TableBox | TableCellBox | @@ -1127,6 +1131,10 @@ impl Box { } /// Attempts to split this box so that its width is no more than `max_width`. + /// + /// A return value of `None` indicates that the box could not be split. + /// Otherwise the split boxes are returned. The left and right boxes are + /// optional due to the possibility of them being whitespace. pub fn split_to_width(&self, max_width: Au, starts_line: bool) -> Option<(Option, Option)> { match self.specific { GenericBox | IframeBox(_) | ImageBox(_) | TableBox | TableCellBox |