diff options
Diffstat (limited to 'src/length.rs')
| -rw-r--r-- | src/length.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/length.rs b/src/length.rs index 5634da19..fb62763e 100644 --- a/src/length.rs +++ b/src/length.rs @@ -150,7 +150,7 @@ impl FromStr for Length { // have valid ASCII chars as subbytes. let split = len - 2; let bytes = src.as_bytes(); - let unit = match &bytes[split..] { + let unit = match &bytes[split ..] { b"pt" => Unit::Pt, b"mm" => Unit::Mm, b"cm" => Unit::Cm, @@ -158,7 +158,7 @@ impl FromStr for Length { _ => return Err(ParseLengthError), }; - src[..split] + src[.. split] .parse::<f64>() .map(|val| Self::new(val, unit)) .map_err(|_| ParseLengthError) |
