Skip to content

Commit 6529872

Browse files
committed
Adjust AsRef impl for Cow
The existing impl had the too-strong requirement of `Clone`, when only `ToOwned` was needed.
1 parent 5e30f05 commit 6529872

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcollections/borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned {
342342
}
343343

344344
#[stable(feature = "rust1", since = "1.0.0")]
345-
impl<'a, T: Clone> AsRef<T> for Cow<'a, T> {
345+
impl<'a, T: ?Sized + ToOwned> AsRef<T> for Cow<'a, T> {
346346
fn as_ref(&self) -> &T {
347347
self
348348
}

0 commit comments

Comments
 (0)