mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Refactor flow construction to make float
less of a special case.
This commit is contained in:
parent
cc4749373a
commit
544a02a250
11 changed files with 48 additions and 125 deletions
|
@ -19,11 +19,11 @@ pub enum FloatKind {
|
|||
}
|
||||
|
||||
impl FloatKind {
|
||||
pub fn from_property(property: float::T) -> FloatKind {
|
||||
pub fn from_property(property: float::T) -> Option<FloatKind> {
|
||||
match property {
|
||||
float::T::none => panic!("can't create a float type from an unfloated property"),
|
||||
float::T::left => FloatKind::Left,
|
||||
float::T::right => FloatKind::Right,
|
||||
float::T::none => None,
|
||||
float::T::left => Some(FloatKind::Left),
|
||||
float::T::right => Some(FloatKind::Right),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue