]> git.lizzy.rs Git - rust.git/blobdiff - library/alloc/src/string.rs
Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
[rust.git] / library / alloc / src / string.rs
index 24f1b3a1c87509888ff5cc3dacf45679732942c0..3118c7189a5ed2ec68bbc502be2ed9e97783d08b 100644 (file)
@@ -2548,6 +2548,15 @@ fn to_string(&self) -> String {
     }
 }
 
+#[cfg(not(no_global_oom_handling))]
+#[stable(feature = "bool_to_string_specialization", since = "CURRENT_RUSTC_VERSION")]
+impl ToString for bool {
+    #[inline]
+    fn to_string(&self) -> String {
+        String::from(if *self { "true" } else { "false" })
+    }
+}
+
 #[cfg(not(no_global_oom_handling))]
 #[stable(feature = "u8_to_string_specialization", since = "1.54.0")]
 impl ToString for u8 {