Skip to content

Commit f6d0f8e

Browse files
aturonalexcrichton
authored andcommitted
Fix bad references to self
1 parent d07f40a commit f6d0f8e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

active/0000-collections-conventions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,10 @@ impl<A: Clone> ToOwned for A {
418418
impl Borrow for str {
419419
type Owned = String;
420420
fn borrow(s: &String) -> &str {
421-
self.as_slice()
421+
s.as_slice()
422422
}
423423
fn borrow_mut(s: &mut String) -> &mut str {
424-
self.as_mut_slice()
424+
s.as_mut_slice()
425425
}
426426
}
427427

@@ -434,10 +434,10 @@ impl ToOwned for str {
434434
impl<T> Borrow for [T] {
435435
type Owned = Vec<T>;
436436
fn borrow(s: &Vec<T>) -> &[T] {
437-
self.as_slice()
437+
s.as_slice()
438438
}
439439
fn borrow_mut(s: &mut Vec<T>) -> &mut [T] {
440-
self.as_mut_slice()
440+
s.as_mut_slice()
441441
}
442442
}
443443

0 commit comments

Comments
 (0)