diff --git a/src/chrono/date.rs b/src/chrono/date.rs index 770e08c5..a36c73ff 100644 --- a/src/chrono/date.rs +++ b/src/chrono/date.rs @@ -701,10 +701,10 @@ mod tests { #[test] fn test_date_fmt() { - assert_eq!(DateZ::from_ymd(2012, 3, 4).unwrap().to_str(), "2012-03-04".to_owned()); - assert_eq!(DateZ::from_ymd(0, 3, 4).unwrap().to_str(), "0000-03-04".to_owned()); - assert_eq!(DateZ::from_ymd(-307, 3, 4).unwrap().to_str(), "-0307-03-04".to_owned()); - assert_eq!(DateZ::from_ymd(12345, 3, 4).unwrap().to_str(), "+12345-03-04".to_owned()); + assert_eq!(DateZ::from_ymd(2012, 3, 4).unwrap().to_str(), "2012-03-04".to_string()); + assert_eq!(DateZ::from_ymd(0, 3, 4).unwrap().to_str(), "0000-03-04".to_string()); + assert_eq!(DateZ::from_ymd(-307, 3, 4).unwrap().to_str(), "-0307-03-04".to_string()); + assert_eq!(DateZ::from_ymd(12345, 3, 4).unwrap().to_str(), "+12345-03-04".to_string()); } } diff --git a/src/chrono/duration.rs b/src/chrono/duration.rs index 43b6bfba..f15e65d9 100644 --- a/src/chrono/duration.rs +++ b/src/chrono/duration.rs @@ -391,15 +391,15 @@ mod tests { #[test] fn test_duration_fmt() { - assert_eq!(Duration::zero().to_str(), "PT0S".to_owned()); - assert_eq!(Duration::days(42).to_str(), "P42D".to_owned()); - assert_eq!(Duration::days(-42).to_str(), "P-42D".to_owned()); - assert_eq!(Duration::seconds(42).to_str(), "PT42S".to_owned()); - assert_eq!(Duration::milliseconds(42).to_str(), "PT0,042S".to_owned()); - assert_eq!(Duration::microseconds(42).to_str(), "PT0,000042S".to_owned()); - assert_eq!(Duration::nanoseconds(42).to_str(), "PT0,000000042S".to_owned()); + assert_eq!(Duration::zero().to_str(), "PT0S".to_string()); + assert_eq!(Duration::days(42).to_str(), "P42D".to_string()); + assert_eq!(Duration::days(-42).to_str(), "P-42D".to_string()); + assert_eq!(Duration::seconds(42).to_str(), "PT42S".to_string()); + assert_eq!(Duration::milliseconds(42).to_str(), "PT0,042S".to_string()); + assert_eq!(Duration::microseconds(42).to_str(), "PT0,000042S".to_string()); + assert_eq!(Duration::nanoseconds(42).to_str(), "PT0,000000042S".to_string()); assert_eq!((Duration::days(7) + Duration::milliseconds(6543)).to_str(), - "P7DT6,543S".to_owned()); + "P7DT6,543S".to_string()); } } diff --git a/src/chrono/time.rs b/src/chrono/time.rs index cd978f51..42c81573 100644 --- a/src/chrono/time.rs +++ b/src/chrono/time.rs @@ -258,13 +258,13 @@ mod tests { #[test] fn test_time_fmt() { - assert_eq!(hmsm(23, 59, 59, 999).to_str(), "23:59:59,999".to_owned()); - assert_eq!(hmsm(23, 59, 59, 1_000).to_str(), "23:59:60".to_owned()); - assert_eq!(hmsm(23, 59, 59, 1_001).to_str(), "23:59:60,001".to_owned()); + assert_eq!(hmsm(23, 59, 59, 999).to_str(), "23:59:59,999".to_string()); + assert_eq!(hmsm(23, 59, 59, 1_000).to_str(), "23:59:60".to_string()); + assert_eq!(hmsm(23, 59, 59, 1_001).to_str(), "23:59:60,001".to_string()); assert_eq!(TimeZ::from_hms_micro(0, 0, 0, 43210).unwrap().to_str(), - "00:00:00,043210".to_owned()); + "00:00:00,043210".to_string()); assert_eq!(TimeZ::from_hms_nano(0, 0, 0, 6543210).unwrap().to_str(), - "00:00:00,006543210".to_owned()); + "00:00:00,006543210".to_string()); } }