Skip to content

Commit

Permalink
slicing--
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Aug 24, 2024
1 parent 1ff571f commit 492e2ee
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions time/src/parsing/parsable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,9 @@ impl sealed::Sealed for Rfc3339 {
// readability, to specify a full-date and full-time separated by
// (say) a space character.
// Specifically, rusqlite uses space separators.
let input = if input.is_empty() {
return Err(InvalidComponent("separator").into());
} else {
&input[1..]
};
let input = input
.get(1..)
.ok_or_else(|| InvalidComponent("separator"))?;

let ParsedItem(input, hour) =
exactly_n_digits::<2, _>(input).ok_or(InvalidComponent("hour"))?;
Expand Down

0 comments on commit 492e2ee

Please sign in to comment.