X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibcore%2Fborrow.rs;h=3e533255becb5e48a86dd72a5e32686c76ff642a;hb=cdbbc25cc31080e189a98c010a0b39a9074d0c50;hp=4d58aaca941833ac047d7282c25261bfad9e329c;hpb=fb3a01354ffecc41d7a189e4dd225d706387a522;p=rust.git diff --git a/src/libcore/borrow.rs b/src/libcore/borrow.rs index 4d58aaca941..3e533255bec 100644 --- a/src/libcore/borrow.rs +++ b/src/libcore/borrow.rs @@ -189,7 +189,7 @@ pub trait Borrow { /// /// [`Borrow`]: trait.Borrow.html #[stable(feature = "rust1", since = "1.0.0")] -pub trait BorrowMut : Borrow { +pub trait BorrowMut: Borrow { /// Mutably borrows from an owned value. /// /// # Examples @@ -211,25 +211,35 @@ pub trait BorrowMut : Borrow { #[stable(feature = "rust1", since = "1.0.0")] impl Borrow for T { - fn borrow(&self) -> &T { self } + fn borrow(&self) -> &T { + self + } } #[stable(feature = "rust1", since = "1.0.0")] impl BorrowMut for T { - fn borrow_mut(&mut self) -> &mut T { self } + fn borrow_mut(&mut self) -> &mut T { + self + } } #[stable(feature = "rust1", since = "1.0.0")] impl Borrow for &T { - fn borrow(&self) -> &T { &**self } + fn borrow(&self) -> &T { + &**self + } } #[stable(feature = "rust1", since = "1.0.0")] impl Borrow for &mut T { - fn borrow(&self) -> &T { &**self } + fn borrow(&self) -> &T { + &**self + } } #[stable(feature = "rust1", since = "1.0.0")] impl BorrowMut for &mut T { - fn borrow_mut(&mut self) -> &mut T { &mut **self } + fn borrow_mut(&mut self) -> &mut T { + &mut **self + } }