Skip to content

Commit

Permalink
Merge pull request #530 from nickelc/remove-try
Browse files Browse the repository at this point in the history
  • Loading branch information
Milo123459 committed Oct 25, 2021
2 parents 61ee2fc + 01eb99b commit e5dfc1b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 1 addition & 2 deletions src/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1485,8 +1485,7 @@ pub mod serde {
where
D: de::Deserializer<'de>,
{
#[allow(deprecated)]
Ok(try!(d.deserialize_i64(MicroSecondsTimestampVisitor)))
Ok(d.deserialize_i64(MicroSecondsTimestampVisitor)?)
}

struct MicroSecondsTimestampVisitor;
Expand Down
4 changes: 0 additions & 4 deletions src/naive/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1534,8 +1534,6 @@ where
F: Fn(&NaiveDateTime) -> Result<String, E>,
E: ::std::fmt::Debug,
{
use naive::{MAX_DATE, MIN_DATE};

assert_eq!(
to_string(&NaiveDate::from_ymd(2016, 7, 8).and_hms_milli(9, 10, 48, 90)).ok(),
Some(r#""2016-07-08T09:10:48.090""#.into())
Expand Down Expand Up @@ -1568,8 +1566,6 @@ where
F: Fn(&str) -> Result<NaiveDateTime, E>,
E: ::std::fmt::Debug,
{
use naive::{MAX_DATE, MIN_DATE};

assert_eq!(
from_str(r#""2016-07-08T09:10:48.090""#).ok(),
Some(NaiveDate::from_ymd(2016, 7, 8).and_hms_milli(9, 10, 48, 90))
Expand Down

0 comments on commit e5dfc1b

Please sign in to comment.