css_parse 0.0.21-canary.c7360308b8

A recursive-descent CSS parser with generic cursor sinks and rich diagnostics.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
pub trait ToNumberValue {
	fn to_number_value(&self) -> Option<f32>;

	fn to_int_value(&self) -> Option<i32> {
		self.to_number_value().map(|f| f as i32)
	}
}

impl<T: ToNumberValue> ToNumberValue for Option<T> {
	fn to_number_value(&self) -> Option<f32> {
		self.as_ref().and_then(|t| t.to_number_value())
	}
}