We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b443a10 + e5c5df8 commit d2272d4Copy full SHA for d2272d4
src/liballoc/string.rs
@@ -2230,6 +2230,14 @@ impl<T: fmt::Display + ?Sized> ToString for T {
2230
}
2231
2232
2233
+#[stable(feature = "char_to_string_specialization", since = "1.46.0")]
2234
+impl ToString for char {
2235
+ #[inline]
2236
+ fn to_string(&self) -> String {
2237
+ String::from(self.encode_utf8(&mut [0; 4]))
2238
+ }
2239
+}
2240
+
2241
#[stable(feature = "str_to_string_specialization", since = "1.9.0")]
2242
impl ToString for str {
2243
#[inline]
0 commit comments