diff options
| author | Aaron Turon <aturon@mozilla.com> | 2015-04-02 22:22:44 -0700 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2015-04-02 22:22:44 -0700 |
| commit | 6529872afcd4934cd16202a67c747df6674f76c6 (patch) | |
| tree | 2061474f043fd5bfa9e1518ed9555618d9c34db3 | |
| parent | 5e30f05a05326018357c6fffdfb872e8a8d2367c (diff) | |
| download | rust-6529872afcd4934cd16202a67c747df6674f76c6.tar.gz rust-6529872afcd4934cd16202a67c747df6674f76c6.zip | |
Adjust `AsRef` impl for `Cow`
The existing impl had the too-strong requirement of `Clone`, when only `ToOwned` was needed.
| -rw-r--r-- | src/libcollections/borrow.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcollections/borrow.rs b/src/libcollections/borrow.rs index 2fe769b73f5..4503ad14e92 100644 --- a/src/libcollections/borrow.rs +++ b/src/libcollections/borrow.rs @@ -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 } |
