提交 cf2773e3 编写于 作者: M Manish Goregaokar

Rollup merge of #23995 - aturon:cow-as-ref, r=huonw

 The existing impl had the too-strong requirement of `Clone`, when only
`ToOwned` was needed.
......@@ -342,7 +342,7 @@ fn into_cow(self) -> Cow<'a, B> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: Clone> AsRef<T> for Cow<'a, T> {
impl<'a, T: ?Sized + ToOwned> AsRef<T> for Cow<'a, T> {
fn as_ref(&self) -> &T {
self
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册