We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ToString
bool
1 parent 3254bef commit 203bbfaCopy full SHA for 203bbfa
library/alloc/src/string.rs
@@ -2548,6 +2548,15 @@ impl ToString for char {
2548
}
2549
2550
2551
+#[cfg(not(no_global_oom_handling))]
2552
+#[stable(feature = "bool_to_string_specialization", since = "CURRENT_RUSTC_VERSION")]
2553
+impl ToString for bool {
2554
+ #[inline]
2555
+ fn to_string(&self) -> String {
2556
+ String::from(if *self { "true" } else { "false" })
2557
+ }
2558
+}
2559
+
2560
#[cfg(not(no_global_oom_handling))]
2561
#[stable(feature = "u8_to_string_specialization", since = "1.54.0")]
2562
impl ToString for u8 {
0 commit comments