bspeice/dtparse

index out of bounds: the len is 5 but the index is 5: dtparse' panicked at dtparse-2.0.0/src/lib.rs:1135:60

Closed this issue · 3 comments

mpetri commented

this test makes dtparse panic:

fn test_dtparse() {
    assert!(dtparse::parse("/2018-fifa-").is_err());
}
mpetri commented

Some more:

#[test]
fn test_dtparse() {
    assert!(dtparse::parse("/2009/07/").is_err());
}

#[test]
fn test_dtparse() {
    assert!(dtparse::parse("2021-09-").is_err());
}
mpetri commented
#[test]
fn test_dtparse() {
    assert!(dtparse::parse("2023-10-11T23:09").is_err());
}
    ```

I was able to replicate the first three, but your last example runs fine in the existing code. Releasing version 2.0.1 with the fixes now.