We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8cc72cd + a0e112b commit 682553dCopy full SHA for 682553d
src/liballoc/str.rs
@@ -28,7 +28,7 @@
28
// It's cleaner to just turn off the unused_imports warning than to fix them.
29
#![allow(unused_imports)]
30
31
-use core::borrow::Borrow;
+use core::borrow::{Borrow, BorrowMut};
32
use core::str::pattern::{Pattern, Searcher, ReverseSearcher, DoubleEndedSearcher};
33
use core::mem;
34
use core::ptr;
@@ -190,6 +190,14 @@ impl Borrow<str> for String {
190
}
191
192
193
+#[stable(feature = "string_borrow_mut", since = "1.36.0")]
194
+impl BorrowMut<str> for String {
195
+ #[inline]
196
+ fn borrow_mut(&mut self) -> &mut str {
197
+ &mut self[..]
198
+ }
199
+}
200
+
201
#[stable(feature = "rust1", since = "1.0.0")]
202
impl ToOwned for str {
203
type Owned = String;
0 commit comments