From 176c36eb2b376d827a6f981f99bda5971feb1087 Mon Sep 17 00:00:00 2001 From: daemoness Date: Sun, 13 Apr 2025 07:59:10 -0700 Subject: [PATCH] Format using latest rustfmt --- src/client/sink.rs | 10 ++++++++-- src/util/dynsized.rs | 20 ++++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/client/sink.rs b/src/client/sink.rs index f3a96e5..c53dca5 100644 --- a/src/client/sink.rs +++ b/src/client/sink.rs @@ -25,7 +25,10 @@ impl<'a, F: FnMut(ClientMsg<'a>)> ClientMsgSink<'a> for F { self(msg); } - type Borrowed<'b> = &'b mut F where F: 'b; + type Borrowed<'b> + = &'b mut F + where + F: 'b; fn borrow_mut(&mut self) -> Self::Borrowed<'_> { self @@ -37,7 +40,10 @@ impl<'a> ClientMsgSink<'static> for &mut QueueEditGuard<'a> { self.push(msg); } - type Borrowed<'b> = &'b mut QueueEditGuard<'a> where Self: 'b; + type Borrowed<'b> + = &'b mut QueueEditGuard<'a> + where + Self: 'b; fn borrow_mut(&mut self) -> Self::Borrowed<'_> { self diff --git a/src/util/dynsized.rs b/src/util/dynsized.rs index dbe535b..7209e0d 100644 --- a/src/util/dynsized.rs +++ b/src/util/dynsized.rs @@ -24,8 +24,14 @@ pub unsafe trait DynSized { unsafe impl DynSized for T { type Metadata = (); const ALIGN: usize = std::mem::align_of::(); - type Ref<'a> = &'a T where Self: 'a; - type RefMut<'a> = &'a mut T where Self: 'a; + type Ref<'a> + = &'a T + where + Self: 'a; + type RefMut<'a> + = &'a mut T + where + Self: 'a; unsafe fn layout(_: &Self::Metadata) -> Layout { std::alloc::Layout::new::() } @@ -43,8 +49,14 @@ unsafe impl DynSized for T { unsafe impl DynSized for [T] { type Metadata = usize; const ALIGN: usize = std::mem::align_of::(); - type Ref<'a> = &'a [T] where Self: 'a; - type RefMut<'a> = &'a mut [T] where Self: 'a; + type Ref<'a> + = &'a [T] + where + Self: 'a; + type RefMut<'a> + = &'a mut [T] + where + Self: 'a; unsafe fn layout(meta: &Self::Metadata) -> Layout { std::alloc::Layout::array::(*meta).unwrap() }