language changes: to_owned() on &str is being deprecated.

This commit is contained in:
Kang Seonghoon 2014-05-30 02:18:27 +09:00
parent 28ceb1e3db
commit c697e1fd92
3 changed files with 17 additions and 17 deletions

View File

@ -701,10 +701,10 @@ mod tests {
#[test] #[test]
fn test_date_fmt() { 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(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_owned()); 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_owned()); 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_owned()); assert_eq!(DateZ::from_ymd(12345, 3, 4).unwrap().to_str(), "+12345-03-04".to_string());
} }
} }

View File

@ -391,15 +391,15 @@ mod tests {
#[test] #[test]
fn test_duration_fmt() { fn test_duration_fmt() {
assert_eq!(Duration::zero().to_str(), "PT0S".to_owned()); assert_eq!(Duration::zero().to_str(), "PT0S".to_string());
assert_eq!(Duration::days(42).to_str(), "P42D".to_owned()); assert_eq!(Duration::days(42).to_str(), "P42D".to_string());
assert_eq!(Duration::days(-42).to_str(), "P-42D".to_owned()); assert_eq!(Duration::days(-42).to_str(), "P-42D".to_string());
assert_eq!(Duration::seconds(42).to_str(), "PT42S".to_owned()); assert_eq!(Duration::seconds(42).to_str(), "PT42S".to_string());
assert_eq!(Duration::milliseconds(42).to_str(), "PT0,042S".to_owned()); assert_eq!(Duration::milliseconds(42).to_str(), "PT0,042S".to_string());
assert_eq!(Duration::microseconds(42).to_str(), "PT0,000042S".to_owned()); assert_eq!(Duration::microseconds(42).to_str(), "PT0,000042S".to_string());
assert_eq!(Duration::nanoseconds(42).to_str(), "PT0,000000042S".to_owned()); assert_eq!(Duration::nanoseconds(42).to_str(), "PT0,000000042S".to_string());
assert_eq!((Duration::days(7) + Duration::milliseconds(6543)).to_str(), assert_eq!((Duration::days(7) + Duration::milliseconds(6543)).to_str(),
"P7DT6,543S".to_owned()); "P7DT6,543S".to_string());
} }
} }

View File

@ -258,13 +258,13 @@ mod tests {
#[test] #[test]
fn test_time_fmt() { 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, 999).to_str(), "23:59:59,999".to_string());
assert_eq!(hmsm(23, 59, 59, 1_000).to_str(), "23:59:60".to_owned()); 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_owned()); 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(), 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(), 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());
} }
} }