style: Make Contain::parse simpler

This commit is contained in:
lizhixun 2018-01-04 13:13:49 -08:00
parent 7a9f99eda8
commit aa1b9a25f6

View file

@ -553,18 +553,8 @@ impl Parse for Contain {
"layout" => Some(Contain::LAYOUT), "layout" => Some(Contain::LAYOUT),
"style" => Some(Contain::STYLE), "style" => Some(Contain::STYLE),
"paint" => Some(Contain::PAINT), "paint" => Some(Contain::PAINT),
"strict" => { "strict" if result.is_empty() => return Ok(Contain::STRICT | Contain::STRICT_BITS),
if result.is_empty() { "none" if result.is_empty() => return Ok(result),
return Ok(Contain::STRICT | Contain::STRICT_BITS)
}
None
},
"none" => {
if result.is_empty() {
return Ok(result)
}
None
},
_ => None _ => None
}; };