bspeice/dtparse

panicked at 'called `Option::unwrap()` on a `None` value'

Closed this issue · 1 comments

Input
99999999999999999999999

Output

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/dtparse-1.2.0/src/lib.rs:1156:51
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::panicking::panic
   9: core::option::Option<T>::unwrap
             at /home/xsh/code/rust-compiler/src/libcore/macros/mod.rs:10
  10: dtparse::Parser::parse_numeric_token
             at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/dtparse-1.2.0/src/lib.rs:1156
  11: dtparse::Parser::parse_with_tokens
             at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/dtparse-1.2.0/src/lib.rs:771
  12: dtparse::Parser::parse
             at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/dtparse-1.2.0/src/lib.rs:719

Expect
return error properly instead of panic

I'm able to recreate this one, taking a look now.