X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fliballoc%2Fborrow.rs;h=51c233a21f1a41ced54ac718792c333dec3f3cae;hb=5c384ab00c7b4b39e457b75d385e9cbe12e699f5;hp=fc9604519684682afd284ecb3d33fa595362c536;hpb=3eeb8d4f2fbae0bb1c587d00b5abeaf938da47f4;p=rust.git diff --git a/src/liballoc/borrow.rs b/src/liballoc/borrow.rs index fc960451968..51c233a21f1 100644 --- a/src/liballoc/borrow.rs +++ b/src/liballoc/borrow.rs @@ -16,8 +16,9 @@ #[stable(feature = "rust1", since = "1.0.0")] impl<'a, B: ?Sized> Borrow for Cow<'a, B> - where B: ToOwned, - ::Owned: 'a +where + B: ToOwned, + ::Owned: 'a, { fn borrow(&self) -> &B { &**self @@ -69,9 +70,7 @@ pub trait ToOwned { /// let mut v: Vec = Vec::new(); /// [1, 2][..].clone_into(&mut v); /// ``` - #[unstable(feature = "toowned_clone_into", - reason = "recently added", - issue = "41263")] + #[unstable(feature = "toowned_clone_into", reason = "recently added", issue = "41263")] fn clone_into(&self, target: &mut Self::Owned) { *target = self.to_owned(); } @@ -79,7 +78,8 @@ fn clone_into(&self, target: &mut Self::Owned) { #[stable(feature = "rust1", since = "1.0.0")] impl ToOwned for T - where T: Clone +where + T: Clone, { type Owned = T; fn to_owned(&self) -> T { @@ -169,17 +169,16 @@ fn clone_into(&self, target: &mut T) { /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub enum Cow<'a, B: ?Sized + 'a> - where B: ToOwned +where + B: ToOwned, { /// Borrowed data. #[stable(feature = "rust1", since = "1.0.0")] - Borrowed(#[stable(feature = "rust1", since = "1.0.0")] - &'a B), + Borrowed(#[stable(feature = "rust1", since = "1.0.0")] &'a B), /// Owned data. #[stable(feature = "rust1", since = "1.0.0")] - Owned(#[stable(feature = "rust1", since = "1.0.0")] - ::Owned), + Owned(#[stable(feature = "rust1", since = "1.0.0")] ::Owned), } #[stable(feature = "rust1", since = "1.0.0")] @@ -335,7 +334,8 @@ impl Eq for Cow<'_, B> where B: Eq + ToOwned {} #[stable(feature = "rust1", since = "1.0.0")] impl Ord for Cow<'_, B> - where B: Ord + ToOwned +where + B: Ord + ToOwned, { #[inline] fn cmp(&self, other: &Self) -> Ordering { @@ -345,8 +345,9 @@ fn cmp(&self, other: &Self) -> Ordering { #[stable(feature = "rust1", since = "1.0.0")] impl<'a, 'b, B: ?Sized, C: ?Sized> PartialEq> for Cow<'a, B> - where B: PartialEq + ToOwned, - C: ToOwned +where + B: PartialEq + ToOwned, + C: ToOwned, { #[inline] fn eq(&self, other: &Cow<'b, C>) -> bool { @@ -356,7 +357,8 @@ fn eq(&self, other: &Cow<'b, C>) -> bool { #[stable(feature = "rust1", since = "1.0.0")] impl<'a, B: ?Sized> PartialOrd for Cow<'a, B> - where B: PartialOrd + ToOwned +where + B: PartialOrd + ToOwned, { #[inline] fn partial_cmp(&self, other: &Cow<'a, B>) -> Option { @@ -403,7 +405,8 @@ fn default() -> Self { #[stable(feature = "rust1", since = "1.0.0")] impl Hash for Cow<'_, B> - where B: Hash + ToOwned +where + B: Hash + ToOwned, { #[inline] fn hash(&self, state: &mut H) {