From 50734d87c8345a89d82b01934b4721086ece0d5e Mon Sep 17 00:00:00 2001 From: Kunwar Padda <63855167+kunwarpadda@users.noreply.github.com> Date: Sun, 26 Jul 2026 09:30:39 -0700 Subject: [PATCH] Improve expect messages in fmt docs --- library/core/src/fmt/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index 4d000691b8b5f..3b434bdfe2c61 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -1611,7 +1611,7 @@ pub trait UpperExp: PointeeSized { /// /// let mut output = String::new(); /// fmt::write(&mut output, format_args!("Hello {}!", "world")) -/// .expect("Error occurred while trying to write in String"); +/// .expect("writing to a String should never fail"); /// assert_eq!(output, "Hello world!"); /// ``` /// @@ -1622,7 +1622,7 @@ pub trait UpperExp: PointeeSized { /// /// let mut output = String::new(); /// write!(&mut output, "Hello {}!", "world") -/// .expect("Error occurred while trying to write in String"); +/// .expect("writing to a String should never fail"); /// assert_eq!(output, "Hello world!"); /// ``` ///