diff --git a/README.md b/README.md index 4fedd245f78..9dc8d224b26 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ let dtf = DateTimeFormatter::try_new( let date = DateTime::try_new_iso(2020, 9, 12, 12, 35, 0).expect("datetime should be valid"); let date = date.to_any(); -let formatted_date = dtf.format_any_calendar(&date).to_string_lossy(); +let formatted_date = dtf.format_any_calendar(&date).to_string(); assert_eq!( formatted_date, "12 de septiembre de 2020, 12:35:00" diff --git a/tutorials/data_management.md b/tutorials/data_management.md index f2c472ed6f2..0fe2ee622e2 100644 --- a/tutorials/data_management.md +++ b/tutorials/data_management.md @@ -116,7 +116,7 @@ fn main() { .expect("datetime should be valid"); let date = date.to_any(); - let formatted_date = dtf.format_any_calendar(&date).to_string_lossy(); + let formatted_date = dtf.format_any_calendar(&date).to_string(); println!("📅: {}", formatted_date); } @@ -182,7 +182,7 @@ fn main() { .expect("datetime should be valid"); let date = date.to_any(); - let formatted_date = dtf.format_any_calendar(&date).to_string_lossy(); + let formatted_date = dtf.format_any_calendar(&date).to_string(); println!("📅: {}", formatted_date); } @@ -234,7 +234,7 @@ fn main() { let date = DateTime::try_new_gregorian(2020, 10, 14, 13, 21, 28) .expect("datetime should be valid"); - let formatted_date = dtf.format(&date).to_string_lossy(); + let formatted_date = dtf.format(&date).to_string(); println!("📅: {}", formatted_date); } diff --git a/tutorials/intro.md b/tutorials/intro.md index e5ac5d77141..73ed5b4b1b5 100644 --- a/tutorials/intro.md +++ b/tutorials/intro.md @@ -126,7 +126,7 @@ fn main() { // For smaller codesize you can use FixedCalendarDateTimeFormatter with a DateTime let date = date.to_any(); - let formatted_date = dtf.format_any_calendar(&date).to_string_lossy(); + let formatted_date = dtf.format_any_calendar(&date).to_string(); println!("📅: {}", formatted_date); } diff --git a/tutorials/intro_interactive.md b/tutorials/intro_interactive.md index f78429d2b38..348513ba9e0 100644 --- a/tutorials/intro_interactive.md +++ b/tutorials/intro_interactive.md @@ -171,7 +171,7 @@ let date_formatter = DateTimeFormatter::try_new( println!( "Date: {}", date_formatter - .format_any_calendar(&iso_date.to_any()).to_string_lossy() + .format_any_calendar(&iso_date.to_any()).to_string() ); ``` diff --git a/tutorials/rust/buffer/src/main.rs b/tutorials/rust/buffer/src/main.rs index 5b83a653270..100e82611ee 100644 --- a/tutorials/rust/buffer/src/main.rs +++ b/tutorials/rust/buffer/src/main.rs @@ -35,7 +35,7 @@ fn main() { let datetime = DateTime::try_new_gregorian(2022, 12, 23, 12, 54, 29) .expect("constant should be valid datetime"); - let result = formatter.format(&datetime).to_string_lossy(); + let result = formatter.format(&datetime).to_string(); assert_eq!(result, "၂၀၂၂ ဒီ ၂၃ ၁၂:၅၄:၂၉"); println!("{result}");