Refactor flow construction to make float less of a special case.

This commit is contained in:
Simon Sapin 2015-04-16 16:51:27 +02:00
parent cc4749373a
commit 544a02a250
11 changed files with 48 additions and 125 deletions

View file

@ -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),
}
}
}