We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ToString
bool
1 parent 5ce31e8 commit fa9db07Copy full SHA for fa9db07
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