@for non-integer error messages

This commit is contained in:
ConnorSkees 2020-02-29 11:54:12 -05:00
parent 659dfba1b2
commit 0adc6f90e3

View File

@ -1,4 +1,3 @@
use std::cmp::Ordering;
use std::fmt::{self, Display};
use std::iter::Peekable;
@ -144,7 +143,7 @@ impl AtRule {
let from = match Value::from_tokens(&mut from_toks.into_iter().peekable(), scope)? {
Value::Dimension(n, _) => match n.to_integer().to_usize() {
Some(v) => v,
None => todo!(),
None => return Err(format!("{} is not a int.", n).into()),
},
v => return Err(format!("{} is not a number.", v).into()),
};
@ -159,7 +158,7 @@ impl AtRule {
let to = match Value::from_tokens(&mut to_toks.into_iter().peekable(), scope)? {
Value::Dimension(n, _) => match n.to_integer().to_usize() {
Some(v) => v,
None => todo!(),
None => return Err(format!("{} is not a int.", n).into()),
},
v => return Err(format!("{} is not a number.", v).into()),
};