Format using latest rustfmt
Some checks failed
CI / MSRV Test (push) Has been cancelled
CI / Code Quality (push) Has been cancelled

This commit is contained in:
daemoness
2025-04-13 07:59:10 -07:00
parent eedcf57994
commit 176c36eb2b
2 changed files with 24 additions and 6 deletions

View File

@@ -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

View File

@@ -24,8 +24,14 @@ pub unsafe trait DynSized {
unsafe impl<T: Sized> DynSized for T {
type Metadata = ();
const ALIGN: usize = std::mem::align_of::<T>();
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::<T>()
}
@@ -43,8 +49,14 @@ unsafe impl<T: Sized> DynSized for T {
unsafe impl<T: Sized> DynSized for [T] {
type Metadata = usize;
const ALIGN: usize = std::mem::align_of::<T>();
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::<T>(*meta).unwrap()
}