Skip to content

Commit

Permalink
Adjust AsRef impl for Cow
Browse files Browse the repository at this point in the history
The existing impl had the too-strong requirement of `Clone`, when only
`ToOwned` was needed.
  • Loading branch information
aturon committed Apr 3, 2015
1 parent 5e30f05 commit 6529872
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcollections/borrow.rs
Expand Up @@ -342,7 +342,7 @@ impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned {
}

#[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
}
Expand Down

0 comments on commit 6529872

Please sign in to comment.