From 1e8df65f47577c0db3e2790660b00d728145cde2 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Thu, 21 Mar 2024 19:19:29 +0100 Subject: [PATCH] Rustfmt doc comments --- src/lib.rs | 15 ++++++++++----- src/naive/datetime/serde.rs | 3 +-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f35b1535bb..6fc07ae183 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,5 @@ //! # Chrono: Date and Time for Rust //! - //! Chrono aims to provide all functionality needed to do correct operations on dates and times in the //! [proleptic Gregorian calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar): //! @@ -255,10 +254,16 @@ //! let dt2 = Utc.with_ymd_and_hms(2014, 11, 14, 10, 9, 8).unwrap(); //! assert_eq!(dt1.signed_duration_since(dt2), TimeDelta::try_seconds(-2 * 3600 + 2).unwrap()); //! assert_eq!(dt2.signed_duration_since(dt1), TimeDelta::try_seconds(2 * 3600 - 2).unwrap()); -//! assert_eq!(Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap() + TimeDelta::try_seconds(1_000_000_000).unwrap(), -//! Utc.with_ymd_and_hms(2001, 9, 9, 1, 46, 40).unwrap()); -//! assert_eq!(Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap() - TimeDelta::try_seconds(1_000_000_000).unwrap(), -//! Utc.with_ymd_and_hms(1938, 4, 24, 22, 13, 20).unwrap()); +//! assert_eq!( +//! Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap() +//! + TimeDelta::try_seconds(1_000_000_000).unwrap(), +//! Utc.with_ymd_and_hms(2001, 9, 9, 1, 46, 40).unwrap() +//! ); +//! assert_eq!( +//! Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap() +//! - TimeDelta::try_seconds(1_000_000_000).unwrap(), +//! Utc.with_ymd_and_hms(1938, 4, 24, 22, 13, 20).unwrap() +//! ); //! ``` //! //! ### Formatting and Parsing diff --git a/src/naive/datetime/serde.rs b/src/naive/datetime/serde.rs index 45c1935d6a..2beda08745 100644 --- a/src/naive/datetime/serde.rs +++ b/src/naive/datetime/serde.rs @@ -1047,8 +1047,7 @@ pub mod ts_seconds_option { /// time: Option, /// } /// - /// let expected = - /// NaiveDate::from_ymd_opt(2018, 5, 17).unwrap().and_hms_opt(02, 04, 59).unwrap(); + /// let expected = NaiveDate::from_ymd_opt(2018, 5, 17).unwrap().and_hms_opt(02, 04, 59).unwrap(); /// let my_s = S { time: Some(expected) }; /// let as_string = serde_json::to_string(&my_s)?; /// assert_eq!(as_string, r#"{"time":1526522699}"#);