Rollup merge of #37587 - ollie27:to_mut, r=alexcrichton
Remove recursive call from Cow::to_mut It seems to prevent it from being inlined.
This commit is contained in:
commit
5bce6ad16a
@ -160,7 +160,10 @@ impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
|
||||
match *self {
|
||||
Borrowed(borrowed) => {
|
||||
*self = Owned(borrowed.to_owned());
|
||||
self.to_mut()
|
||||
match *self {
|
||||
Borrowed(..) => unreachable!(),
|
||||
Owned(ref mut owned) => owned,
|
||||
}
|
||||
}
|
||||
Owned(ref mut owned) => owned,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user