mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 10:39:45 +00:00
cargo fmt
This commit is contained in:
parent
87f837cec7
commit
7535bb4661
571 changed files with 2210 additions and 2458 deletions
|
|
@ -202,11 +202,7 @@ pub fn trim_indent(mut text: &str) -> String {
|
|||
text.split_inclusive('\n')
|
||||
.map(
|
||||
|line| {
|
||||
if line.len() <= indent {
|
||||
line.trim_start_matches(' ')
|
||||
} else {
|
||||
&line[indent..]
|
||||
}
|
||||
if line.len() <= indent { line.trim_start_matches(' ') } else { &line[indent..] }
|
||||
},
|
||||
)
|
||||
.collect()
|
||||
|
|
|
|||
|
|
@ -158,9 +158,9 @@ mod imp {
|
|||
};
|
||||
|
||||
use miow::{
|
||||
Overlapped,
|
||||
iocp::{CompletionPort, CompletionStatus},
|
||||
pipe::NamedPipe,
|
||||
Overlapped,
|
||||
};
|
||||
use windows_sys::Win32::Foundation::ERROR_BROKEN_PIPE;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use std::alloc::{dealloc, handle_alloc_error, Layout};
|
||||
use std::alloc::{Layout, dealloc, handle_alloc_error};
|
||||
use std::fmt;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::ptr::{addr_of_mut, slice_from_raw_parts_mut, NonNull};
|
||||
use std::ptr::{NonNull, addr_of_mut, slice_from_raw_parts_mut};
|
||||
|
||||
/// A type that is functionally equivalent to `(Header, Box<[Item]>)`,
|
||||
/// but all data is stored in one heap allocation and the pointer is thin,
|
||||
|
|
@ -322,11 +322,7 @@ impl<T> EmptyOptimizedThinVec<T> {
|
|||
I::IntoIter: TrustedLen<Item = T>,
|
||||
{
|
||||
let values = values.into_iter();
|
||||
if values.len() == 0 {
|
||||
Self::empty()
|
||||
} else {
|
||||
Self(Some(ThinVec::from_iter(values)))
|
||||
}
|
||||
if values.len() == 0 { Self::empty() } else { Self(Some(ThinVec::from_iter(values))) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
use std::{
|
||||
panic::{self, UnwindSafe},
|
||||
sync::{
|
||||
atomic::{AtomicUsize, Ordering},
|
||||
Arc,
|
||||
atomic::{AtomicUsize, Ordering},
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue