diff options
Diffstat (limited to 'src/liballoc/string.rs')
| -rw-r--r-- | src/liballoc/string.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 91b6d526796..64d9692244d 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -2230,6 +2230,14 @@ impl<T: fmt::Display + ?Sized> ToString for T { } } +#[stable(feature = "char_to_string_specialization", since = "1.46.0")] +impl ToString for char { + #[inline] + fn to_string(&self) -> String { + String::from(self.encode_utf8(&mut [0; 4])) + } +} + #[stable(feature = "str_to_string_specialization", since = "1.9.0")] impl ToString for str { #[inline] |
