Skip to content

Commit

Permalink
Consume correct number of chars when using padding
Browse files Browse the repository at this point in the history
Fixes #200
  • Loading branch information
jhpratt committed Jan 8, 2020
1 parent c063a3c commit 208a3d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "time"
version = "0.2.1"
version = "0.2.2"
authors = ["Jacob Pratt <the.z.cuber@gmail.com>"]
edition = "2018"
exclude = [".github", ".editorconfig", "rustfmt.toml"]
Expand Down
2 changes: 1 addition & 1 deletion src/format/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ pub(crate) fn try_consume_exact_digits<T: FromStr>(
// length is equal to the number of bytes, as ASCII values are always one
// byte in Unicode.
let digits = &s[..(num_digits - pad_size)];
*s = &s[num_digits..];
*s = &s[(num_digits - pad_size)..];
digits.parse::<T>().ok()
}
}
Expand Down

0 comments on commit 208a3d3

Please sign in to comment.