diff options
| author | Martin <mhaug@live.de> | 2021-12-26 17:34:04 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2021-12-27 12:33:53 +0100 |
| commit | 7efdcdf2472257102c6b4b30bf285e2058924070 (patch) | |
| tree | 9749c485b4ef25d1d68fcd248917f891b9ec9677 /src/library/page.rs | |
| parent | b22ce6f8b84e0a75d162feb6f3699e26f86f2453 (diff) | |
Apply simple suggestions from code review
Co-Authored-By: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'src/library/page.rs')
| -rw-r--r-- | src/library/page.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/page.rs b/src/library/page.rs index 6585edb9..100b4d0c 100644 --- a/src/library/page.rs +++ b/src/library/page.rs @@ -41,7 +41,7 @@ impl PageNode { /// The page's background color. pub const FILL: Option<Paint> = None; /// How many columns the page has. - pub const COLUMNS: usize = 1; + pub const COLUMNS: NonZeroUsize = NonZeroUsize::new(1).unwrap(); /// How many columns the page has. pub const COLUMN_GUTTER: Linear = Relative::new(0.04).into(); } @@ -119,11 +119,11 @@ impl PageNode { }; let columns = ctx.styles.get(Self::COLUMNS); - let child = if ctx.styles.get(Self::COLUMNS) > 1 { + let child = if columns.get() > 1 { ColumnsNode { - child: self.child.clone(), columns, gutter: ctx.styles.get(Self::COLUMN_GUTTER), + child: self.child.clone(), } .pack() } else { |
