Address review comments

This commit is contained in:
Manish Goregaokar 2016-07-19 10:50:11 +05:30
parent 704d7a01c9
commit f51b115db0
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98
4 changed files with 15 additions and 13 deletions

View file

@ -14,7 +14,7 @@ impl From<CalcLengthOrPercentage> for nsStyleCoord_CalcValue {
fn from(other: CalcLengthOrPercentage) -> nsStyleCoord_CalcValue {
let has_percentage = other.percentage.is_some();
nsStyleCoord_CalcValue {
mLength: other.length.map(|l| l.0).unwrap_or(0),
mLength: other.length.map_or(0, |l| l.0),
mPercent: other.percentage.unwrap_or(0.0),
mHasPercent: has_percentage,
}