提交 5bce6ad1 编写于 作者: A Alex Crichton

Rollup merge of #37587 - ollie27:to_mut, r=alexcrichton

Remove recursive call from Cow::to_mut

It seems to prevent it from being inlined.
......@@ -160,7 +160,10 @@ pub fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned {
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,
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册