diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2020-02-09 18:23:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-09 18:23:30 +0100 |
| commit | 3516df3ecbc97a449221e7a02cf750bf8726b5c1 (patch) | |
| tree | 8c8b2ed3d4219a80d3390e6f47faf007e58bc88e /src/liballoc | |
| parent | 0b50319af69d52ce9806e91fba777986dec4e417 (diff) | |
| parent | fd2282388140ea0f370ee25c82f00be81c2f822c (diff) | |
| download | rust-3516df3ecbc97a449221e7a02cf750bf8726b5c1.tar.gz rust-3516df3ecbc97a449221e7a02cf750bf8726b5c1.zip | |
Rollup merge of #68742 - tspiteri:string-as-mut, r=sfackler
implement AsMut<str> for String Closes #68741.
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 8c9c95eec60..3cb1f259a0b 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] |
