Skip to content

Commit 1e8df65

Browse files
committed
Rustfmt doc comments
1 parent 1b57859 commit 1e8df65

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/lib.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! # Chrono: Date and Time for Rust
22
//!
3-
43
//! Chrono aims to provide all functionality needed to do correct operations on dates and times in the
54
//! [proleptic Gregorian calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar):
65
//!
@@ -255,10 +254,16 @@
255254
//! let dt2 = Utc.with_ymd_and_hms(2014, 11, 14, 10, 9, 8).unwrap();
256255
//! assert_eq!(dt1.signed_duration_since(dt2), TimeDelta::try_seconds(-2 * 3600 + 2).unwrap());
257256
//! assert_eq!(dt2.signed_duration_since(dt1), TimeDelta::try_seconds(2 * 3600 - 2).unwrap());
258-
//! assert_eq!(Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap() + TimeDelta::try_seconds(1_000_000_000).unwrap(),
259-
//! Utc.with_ymd_and_hms(2001, 9, 9, 1, 46, 40).unwrap());
260-
//! assert_eq!(Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap() - TimeDelta::try_seconds(1_000_000_000).unwrap(),
261-
//! Utc.with_ymd_and_hms(1938, 4, 24, 22, 13, 20).unwrap());
257+
//! assert_eq!(
258+
//! Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap()
259+
//! + TimeDelta::try_seconds(1_000_000_000).unwrap(),
260+
//! Utc.with_ymd_and_hms(2001, 9, 9, 1, 46, 40).unwrap()
261+
//! );
262+
//! assert_eq!(
263+
//! Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap()
264+
//! - TimeDelta::try_seconds(1_000_000_000).unwrap(),
265+
//! Utc.with_ymd_and_hms(1938, 4, 24, 22, 13, 20).unwrap()
266+
//! );
262267
//! ```
263268
//!
264269
//! ### Formatting and Parsing

src/naive/datetime/serde.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1047,8 +1047,7 @@ pub mod ts_seconds_option {
10471047
/// time: Option<NaiveDateTime>,
10481048
/// }
10491049
///
1050-
/// let expected =
1051-
/// NaiveDate::from_ymd_opt(2018, 5, 17).unwrap().and_hms_opt(02, 04, 59).unwrap();
1050+
/// let expected = NaiveDate::from_ymd_opt(2018, 5, 17).unwrap().and_hms_opt(02, 04, 59).unwrap();
10521051
/// let my_s = S { time: Some(expected) };
10531052
/// let as_string = serde_json::to_string(&my_s)?;
10541053
/// assert_eq!(as_string, r#"{"time":1526522699}"#);

0 commit comments

Comments
 (0)