aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/multicol.rs
diff options
context:
space:
mode:
authorXidorn Quan <me@upsuper.org>2017-03-17 17:52:45 +1100
committerXidorn Quan <me@upsuper.org>2017-03-17 23:08:05 +1100
commitab0e5c9d996af6ace9b9c7b59d2bde6d695c4806 (patch)
treec26a7f9fef3a414bbb3936c783765d965afda09b /components/layout/multicol.rs
parent9233882d49a622629f2465198fdc3ac0da52340b (diff)
downloadservo-ab0e5c9d996af6ace9b9c7b59d2bde6d695c4806.tar.gz
servo-ab0e5c9d996af6ace9b9c7b59d2bde6d695c4806.zip
Switch column-count to use predefined integer type
Diffstat (limited to 'components/layout/multicol.rs')
-rw-r--r--components/layout/multicol.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs
index 9e341d96d01..18cfe6409cb 100644
--- a/components/layout/multicol.rs
+++ b/components/layout/multicol.rs
@@ -106,11 +106,14 @@ impl Flow for MulticolFlow {
if let Either::First(column_width) = column_style.column_width {
column_count =
max(1, (content_inline_size + column_gap).0 / (column_width + column_gap).0);
- if let Some(specified_column_count) = column_style.column_count.0 {
+ if let Either::First(specified_column_count) = column_style.column_count {
column_count = min(column_count, specified_column_count as i32);
}
} else {
- column_count = column_style.column_count.0.unwrap() as i32;
+ column_count = match column_style.column_count {
+ Either::First(n) => n,
+ _ => unreachable!(),
+ }
}
column_width =
max(Au(0), (content_inline_size + column_gap) / column_count - column_gap);