Skip to content

Commit

Permalink
Fix rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Dec 28, 2024
1 parent 2e49b41 commit 6397204
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
10 changes: 8 additions & 2 deletions crates/borrowme/src/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ impl<T> Borrow for Option<T>
where
T: Borrow,
{
type Target<'a> = Option<T::Target<'a>> where T: 'a;
type Target<'a>
= Option<T::Target<'a>>
where
T: 'a;

#[inline]
fn borrow(&self) -> Self::Target<'_> {
Expand All @@ -101,7 +104,10 @@ where
}

impl<T> Borrow for [T] {
type Target<'a> = &'a [T] where T: 'a;
type Target<'a>
= &'a [T]
where
T: 'a;

#[inline]
fn borrow(&self) -> Self::Target<'_> {
Expand Down
10 changes: 8 additions & 2 deletions crates/borrowme/src/borrow/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ where
macro_rules! deref {
($from:ty, $to:ty) => {
impl Borrow for $from {
type Target<'a> = &'a $to where Self: 'a;
type Target<'a>
= &'a $to
where
Self: 'a;

#[inline]
fn borrow(&self) -> Self::Target<'_> {
Expand All @@ -47,7 +50,10 @@ deref!(OsString, OsStr);
deref!(CString, CStr);

impl<T: ?Sized> Borrow for Box<T> {
type Target<'a> = &'a T where T: 'a;
type Target<'a>
= &'a T
where
T: 'a;

#[inline]
fn borrow(&self) -> Self::Target<'_> {
Expand Down
10 changes: 8 additions & 2 deletions crates/borrowme/src/borrow_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ impl<T> BorrowMut for Option<T>
where
T: BorrowMut,
{
type TargetMut<'a> = Option<T::TargetMut<'a>> where T: 'a;
type TargetMut<'a>
= Option<T::TargetMut<'a>>
where
T: 'a;

#[inline]
fn borrow_mut(&mut self) -> Self::TargetMut<'_> {
Expand All @@ -103,7 +106,10 @@ where
}

impl<T> BorrowMut for [T] {
type TargetMut<'a> = &'a mut [T] where T: 'a;
type TargetMut<'a>
= &'a mut [T]
where
T: 'a;

#[inline]
fn borrow_mut(&mut self) -> Self::TargetMut<'_> {
Expand Down

0 comments on commit 6397204

Please sign in to comment.