Skip to content

Commit a84b78c

Browse files
CoAlloc: tidy
1 parent 5bbf264 commit a84b78c

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

library/alloc/src/collections/binary_heap/tests.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::*;
22
use crate::boxed::Box;
3-
use crate::{CO_ALLOC_PREF_META_YES, CO_ALLOC_PREF_META_NO};
43
use crate::testing::crash_test::{CrashTestDummy, Panic};
4+
use crate::{CO_ALLOC_PREF_META_NO, CO_ALLOC_PREF_META_YES};
55
use core::mem;
66
use std::iter::TrustedLen;
77
use std::panic::{catch_unwind, AssertUnwindSafe};
@@ -449,10 +449,14 @@ fn test_extend_specialization() {
449449

450450
#[allow(dead_code)]
451451
fn assert_covariance() {
452-
fn drain<'new>(d: Drain<'static, &'static str, {CO_ALLOC_PREF_META_NO!()}>) -> Drain<'new, &'new str, {CO_ALLOC_PREF_META_NO!()}> {
452+
fn drain<'new>(
453+
d: Drain<'static, &'static str, { CO_ALLOC_PREF_META_NO!() }>,
454+
) -> Drain<'new, &'new str, { CO_ALLOC_PREF_META_NO!() }> {
453455
d
454456
}
455-
fn drain_co<'new>(d: Drain<'static, &'static str, {CO_ALLOC_PREF_META_YES!()}>) -> Drain<'new, &'new str, {CO_ALLOC_PREF_META_YES!()}> {
457+
fn drain_co<'new>(
458+
d: Drain<'static, &'static str, { CO_ALLOC_PREF_META_YES!() }>,
459+
) -> Drain<'new, &'new str, { CO_ALLOC_PREF_META_YES!() }> {
456460
d
457461
}
458462
}

library/alloc/src/collections/vec_deque/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2844,8 +2844,7 @@ where
28442844

28452845
#[stable(feature = "rust1", since = "1.0.0")]
28462846
#[allow(unused_braces)]
2847-
impl<T> FromIterator<T> for VecDeque<T>
2848-
{
2847+
impl<T> FromIterator<T> for VecDeque<T> {
28492848
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> VecDeque<T> {
28502849
SpecFromIterCo::spec_from_iter_co(iter.into_iter())
28512850
}

library/alloc/src/slice.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,11 @@ pub(crate) mod hack {
103103
// `vec!` macro mostly and causes perf regression. See #71204 for
104104
// discussion and perf results.
105105
#[allow(unused_braces)]
106-
pub fn into_vec<T, A: Allocator>(
107-
b: Box<[T], A>,
108-
) -> Vec<T, A>
106+
pub fn into_vec<T, A: Allocator>(b: Box<[T], A>) -> Vec<T, A>
109107
where
110108
[(); { crate::meta_num_slots_default!(A) }]:,
111109
{
112-
into_vec_co::<T, A, {crate::CO_ALLOC_PREF_META_DEFAULT!()}>(b)
110+
into_vec_co::<T, A, { crate::CO_ALLOC_PREF_META_DEFAULT!() }>(b)
113111
}
114112

115113
#[allow(unused_braces)]

0 commit comments

Comments
 (0)