style: Allow trailing whitespace in a calc expression.

This commit is contained in:
Emilio Cobos Álvarez 2017-03-08 17:07:54 +01:00
parent 20d0e71232
commit 1eb24f1adc
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -588,6 +588,9 @@ impl CalcLengthOrPercentage {
let position = input.position();
match input.next_including_whitespace() {
Ok(Token::WhiteSpace(_)) => {
if input.is_exhausted() {
break; // allow trailing whitespace
}
match input.next() {
Ok(Token::Delim('+')) => {
products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit)));