Fix the integer setting of the GridLine struct

GridLine line_num shouldn't be set if it's not parsed. So we can determine if it's set or not for serialization.
This commit is contained in:
Nazım Can Altınova 2017-07-17 23:18:21 -07:00
parent 46780ceb0d
commit 638a306168
2 changed files with 5 additions and 6 deletions

View file

@ -119,9 +119,7 @@ impl Parse for GridLine {
if i.value() <= 0 { // disallow negative integers for grid spans
return Err(StyleParseError::UnspecifiedError.into())
}
} else if grid_line.ident.is_some() { // integer could be omitted
grid_line.line_num = Some(Integer::new(1));
} else {
} else if grid_line.ident.is_none() { // integer could be omitted
return Err(StyleParseError::UnspecifiedError.into())
}
}