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),
"style" => Some(Contain::STYLE),
"paint" => Some(Contain::PAINT),
"strict" => {
if result.is_empty() {
return Ok(Contain::STRICT | Contain::STRICT_BITS)
}
None
},
"none" => {
if result.is_empty() {
return Ok(result)
}
None
},
"strict" if result.is_empty() => return Ok(Contain::STRICT | Contain::STRICT_BITS),
"none" if result.is_empty() => return Ok(result),
_ => None
};