about summary refs log tree commit diff
path: root/src/liballoc/borrow.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/liballoc/borrow.rs')
-rw-r--r--src/liballoc/borrow.rs34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/liballoc/borrow.rs b/src/liballoc/borrow.rs
index b47337e44b2..270f48e8083 100644
--- a/src/liballoc/borrow.rs
+++ b/src/liballoc/borrow.rs
@@ -6,14 +6,14 @@ use core::cmp::Ordering;
 use core::hash::{Hash, Hasher};
 use core::ops::{Add, AddAssign, Deref};
 
-use fmt;
-use string::String;
-
-use self::Cow::*;
-
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::borrow::{Borrow, BorrowMut};
 
+use crate::fmt;
+use crate::string::String;
+
+use Cow::*;
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, B: ?Sized> Borrow<B> for Cow<'a, B>
     where B: ToOwned,
@@ -182,9 +182,7 @@ pub enum Cow<'a, B: ?Sized + 'a>
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<'a, B: ?Sized> Clone for Cow<'a, B>
-    where B: ToOwned
-{
+impl<'a, B: ?Sized + ToOwned> Clone for Cow<'a, B> {
     fn clone(&self) -> Cow<'a, B> {
         match *self {
             Borrowed(b) => Borrowed(b),
@@ -207,9 +205,7 @@ impl<'a, B: ?Sized> Clone for Cow<'a, B>
     }
 }
 
-impl<'a, B: ?Sized> Cow<'a, B>
-    where B: ToOwned
-{
+impl<B: ?Sized + ToOwned> Cow<'_, B> {
     /// Acquires a mutable reference to the owned form of the data.
     ///
     /// Clones the data if it is not already owned.
@@ -285,9 +281,7 @@ impl<'a, B: ?Sized> Cow<'a, B>
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<'a, B: ?Sized> Deref for Cow<'a, B>
-    where B: ToOwned
-{
+impl<B: ?Sized + ToOwned> Deref for Cow<'_, B> {
     type Target = B;
 
     fn deref(&self) -> &B {
@@ -299,7 +293,7 @@ impl<'a, B: ?Sized> Deref for Cow<'a, B>
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<'a, B: ?Sized> Eq for Cow<'a, B> where B: Eq + ToOwned {}
+impl<B: ?Sized> Eq for Cow<'_, B> where B: Eq + ToOwned {}
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, B: ?Sized> Ord for Cow<'a, B>
@@ -333,11 +327,11 @@ impl<'a, B: ?Sized> PartialOrd for Cow<'a, B>
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<'a, B: ?Sized> fmt::Debug for Cow<'a, B>
+impl<B: ?Sized> fmt::Debug for Cow<'_, B>
     where B: fmt::Debug + ToOwned,
           <B as ToOwned>::Owned: fmt::Debug
 {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             Borrowed(ref b) => fmt::Debug::fmt(b, f),
             Owned(ref o) => fmt::Debug::fmt(o, f),
@@ -346,11 +340,11 @@ impl<'a, B: ?Sized> fmt::Debug for Cow<'a, B>
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<'a, B: ?Sized> fmt::Display for Cow<'a, B>
+impl<B: ?Sized> fmt::Display for Cow<'_, B>
     where B: fmt::Display + ToOwned,
           <B as ToOwned>::Owned: fmt::Display
 {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             Borrowed(ref b) => fmt::Display::fmt(b, f),
             Owned(ref o) => fmt::Display::fmt(o, f),
@@ -380,7 +374,7 @@ impl<'a, B: ?Sized> Hash for Cow<'a, B>
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<'a, T: ?Sized + ToOwned> AsRef<T> for Cow<'a, T> {
+impl<T: ?Sized + ToOwned> AsRef<T> for Cow<'_, T> {
     fn as_ref(&self) -> &T {
         self
     }