diff options
| author | Trevor Spiteri <tspiteri@ieee.org> | 2020-02-01 22:19:28 +0100 |
|---|---|---|
| committer | Trevor Spiteri <tspiteri@ieee.org> | 2020-02-01 22:19:28 +0100 |
| commit | fd2282388140ea0f370ee25c82f00be81c2f822c (patch) | |
| tree | 7c49a3e2bc522f70be26af2972b72fd76069c5f3 /src/liballoc | |
| parent | 64184a3288eca13ddfb7bc2e7b5231cbb8d5b88f (diff) | |
| download | rust-fd2282388140ea0f370ee25c82f00be81c2f822c.tar.gz rust-fd2282388140ea0f370ee25c82f00be81c2f822c.zip | |
implement AsMut<str> for String
Diffstat (limited to 'src/liballoc')
| -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 96f871d8897..99725917b5d 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -2208,6 +2208,14 @@ impl AsRef<str> for String { } } +#[stable(feature = "string_as_mut", since = "1.43.0")] +impl AsMut<str> for String { + #[inline] + fn as_mut(&mut self) -> &mut str { + self + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl AsRef<[u8]> for String { #[inline] |
