Skip to content

Commit 5f42f5f

Browse files
authored
Auto merge of #227 - SamuelMarks:rustfmt, r=mbrubeck
[*.rs] rustfmt
2 parents 7bda9ec + fbd1739 commit 5f42f5f

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

lib.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,11 @@ fn infallible<T>(result: Result<T, CollectionAllocErr>) -> T {
247247
/// FIXME: use `Layout::array` when we require a Rust version where it’s stable
248248
/// https://github.com/rust-lang/rust/issues/55724
249249
fn layout_array<T>(n: usize) -> Result<Layout, CollectionAllocErr> {
250-
let size = mem::size_of::<T>().checked_mul(n)
250+
let size = mem::size_of::<T>()
251+
.checked_mul(n)
251252
.ok_or(CollectionAllocErr::CapacityOverflow)?;
252253
let align = mem::align_of::<T>();
253-
Layout::from_size_align(size, align)
254-
.map_err(|_| CollectionAllocErr::CapacityOverflow)
254+
Layout::from_size_align(size, align).map_err(|_| CollectionAllocErr::CapacityOverflow)
255255
}
256256

257257
unsafe fn deallocate<T>(ptr: *mut T, capacity: usize) {
@@ -1834,7 +1834,9 @@ impl<'a> Drop for SetLenOnDrop<'a> {
18341834
#[cfg(feature = "const_generics")]
18351835
unsafe impl<T, const N: usize> Array for [T; N] {
18361836
type Item = T;
1837-
fn size() -> usize { N }
1837+
fn size() -> usize {
1838+
N
1839+
}
18381840
}
18391841

18401842
#[cfg(not(feature = "const_generics"))]
@@ -1857,13 +1859,15 @@ impl_array!(
18571859
);
18581860

18591861
/// Convenience trait for constructing a `SmallVec`
1860-
pub trait ToSmallVec<A:Array> {
1862+
pub trait ToSmallVec<A: Array> {
18611863
/// Construct a new `SmallVec` from a slice.
18621864
fn to_smallvec(&self) -> SmallVec<A>;
18631865
}
18641866

1865-
impl<A:Array> ToSmallVec<A> for [A::Item]
1866-
where A::Item: Copy {
1867+
impl<A: Array> ToSmallVec<A> for [A::Item]
1868+
where
1869+
A::Item: Copy,
1870+
{
18671871
#[inline]
18681872
fn to_smallvec(&self) -> SmallVec<A> {
18691873
SmallVec::from_slice(self)

tests/macro.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ fn smallvec() {
2222
check!([1, 2]);
2323
check!([1, 2, 3]);
2424
}
25-

0 commit comments

Comments
 (0)