mirror of
https://github.com/vinezombie/vinezombie.git
synced 2026-01-24 23:17:34 +00:00
Format using latest rustfmt
Some checks failed
CI / MSRV Test (push) Has been cancelled
CI / Code Quality (push) Has been cancelled
Some checks failed
CI / MSRV Test (push) Has been cancelled
CI / Code Quality (push) Has been cancelled
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user