Skip to content

Commit 2396780

Browse files
committed
liballoc: revert nested imports style changes.
1 parent 285106a commit 2396780

34 files changed

+305
-406
lines changed

src/liballoc/alloc.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
33
#![stable(feature = "alloc_module", since = "1.28.0")]
44

5-
use core::{
6-
intrinsics::{min_align_of_val, size_of_val},
7-
ptr::{NonNull, Unique},
8-
usize,
9-
};
5+
use core::intrinsics::{min_align_of_val, size_of_val};
6+
use core::ptr::{NonNull, Unique};
7+
use core::usize;
108

119
#[stable(feature = "alloc_module", since = "1.28.0")]
1210
#[doc(inline)]
@@ -230,10 +228,8 @@ pub fn handle_alloc_error(layout: Layout) -> ! {
230228
mod tests {
231229
extern crate test;
232230
use test::Bencher;
233-
use crate::{
234-
boxed::Box,
235-
alloc::{Global, Alloc, Layout, handle_alloc_error},
236-
};
231+
use crate::boxed::Box;
232+
use crate::alloc::{Global, Alloc, Layout, handle_alloc_error};
237233

238234
#[test]
239235
fn allocate_zeroed() {

src/liballoc/benches/btree/map.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
use std::{
2-
iter::Iterator,
3-
vec::Vec,
4-
collections::BTreeMap,
5-
};
1+
use std::iter::Iterator;
2+
use std::vec::Vec;
3+
use std::collections::BTreeMap;
4+
65
use rand::{Rng, seq::SliceRandom, thread_rng};
76
use test::{Bencher, black_box};
87

src/liballoc/benches/slice.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use std::{mem, ptr};
2-
use rand::{
3-
thread_rng, Rng, SeedableRng,
4-
distributions::{Standard, Alphanumeric},
5-
};
2+
3+
use rand::{thread_rng, Rng, SeedableRng};
4+
use rand::distributions::{Standard, Alphanumeric};
65
use rand_xorshift::XorShiftRng;
76
use test::{Bencher, black_box};
87

src/liballoc/borrow.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
33
#![stable(feature = "rust1", since = "1.0.0")]
44

5-
use core::{
6-
cmp::Ordering,
7-
hash::{Hash, Hasher},
8-
ops::{Add, AddAssign, Deref},
9-
};
5+
use core::cmp::Ordering;
6+
use core::hash::{Hash, Hasher};
7+
use core::ops::{Add, AddAssign, Deref};
108

119
#[stable(feature = "rust1", since = "1.0.0")]
1210
pub use core::borrow::{Borrow, BorrowMut};
1311

14-
use crate::{fmt, string::String};
12+
use crate::fmt;
13+
use crate::string::String;
1514

1615
use Cow::*;
1716

src/liballoc/boxed.rs

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,26 @@
5656
5757
#![stable(feature = "rust1", since = "1.0.0")]
5858

59-
use core::{
60-
any::Any,
61-
borrow,
62-
cmp::Ordering,
63-
convert::From,
64-
fmt,
65-
future::Future,
66-
hash::{Hash, Hasher},
67-
iter::{Iterator, FromIterator, FusedIterator},
68-
marker::{Unpin, Unsize},
69-
mem,
70-
pin::Pin,
71-
ops::{CoerceUnsized, DispatchFromDyn, Deref, DerefMut, Receiver, Generator, GeneratorState},
72-
ptr::{self, NonNull, Unique},
73-
task::{LocalWaker, Poll},
59+
use core::any::Any;
60+
use core::borrow;
61+
use core::cmp::Ordering;
62+
use core::convert::From;
63+
use core::fmt;
64+
use core::future::Future;
65+
use core::hash::{Hash, Hasher};
66+
use core::iter::{Iterator, FromIterator, FusedIterator};
67+
use core::marker::{Unpin, Unsize};
68+
use core::mem;
69+
use core::pin::Pin;
70+
use core::ops::{
71+
CoerceUnsized, DispatchFromDyn, Deref, DerefMut, Receiver, Generator, GeneratorState
7472
};
73+
use core::ptr::{self, NonNull, Unique};
74+
use core::task::{LocalWaker, Poll};
7575

76-
use crate::{
77-
vec::Vec,
78-
raw_vec::RawVec,
79-
str::from_boxed_utf8_unchecked,
80-
};
76+
use crate::vec::Vec;
77+
use crate::raw_vec::RawVec;
78+
use crate::str::from_boxed_utf8_unchecked;
8179

8280
/// A pointer type for heap allocation.
8381
///

src/liballoc/boxed_test.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
//! Test for `boxed` mod.
22
3-
use core::{
4-
any::Any,
5-
ops::Deref,
6-
result::Result::{Err, Ok},
7-
clone::Clone,
8-
f64,
9-
i64,
10-
};
3+
use core::any::Any;
4+
use core::ops::Deref;
5+
use core::result::Result::{Err, Ok};
6+
use core::clone::Clone;
7+
use core::f64;
8+
use core::i64;
119

1210
use std::boxed::Box;
1311

src/liballoc/collections/binary_heap.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,14 @@
145145
#![allow(missing_docs)]
146146
#![stable(feature = "rust1", since = "1.0.0")]
147147

148-
use core::{
149-
ops::{Deref, DerefMut},
150-
iter::{FromIterator, FusedIterator},
151-
mem::{swap, size_of, ManuallyDrop},
152-
ptr,
153-
fmt,
154-
};
155-
156-
use crate::{
157-
slice,
158-
vec::{self, Vec},
159-
};
148+
use core::ops::{Deref, DerefMut};
149+
use core::iter::{FromIterator, FusedIterator};
150+
use core::mem::{swap, size_of, ManuallyDrop};
151+
use core::ptr;
152+
use core::fmt;
153+
154+
use crate::slice;
155+
use crate::vec::{self, Vec};
160156

161157
use super::SpecExtend;
162158

src/liballoc/collections/btree/map.rs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
use core::{
2-
borrow::Borrow,
3-
cmp::Ordering,
4-
fmt::Debug,
5-
hash::{Hash, Hasher},
6-
iter::{FromIterator, Peekable, FusedIterator},
7-
marker::PhantomData,
8-
ops::{
9-
Bound::{Excluded, Included, Unbounded},
10-
Index, RangeBounds,
11-
},
12-
fmt, intrinsics, mem, ptr,
13-
};
14-
15-
use super::{
16-
node::{self, Handle, NodeRef, marker, InsertResult::*, ForceResult::*},
17-
search::{self, SearchResult::*},
18-
};
1+
use core::borrow::Borrow;
2+
use core::cmp::Ordering;
3+
use core::fmt::Debug;
4+
use core::hash::{Hash, Hasher};
5+
use core::iter::{FromIterator, Peekable, FusedIterator};
6+
use core::marker::PhantomData;
7+
use core::ops::Bound::{Excluded, Included, Unbounded};
8+
use core::ops::{Index, RangeBounds};
9+
use core::{fmt, intrinsics, mem, ptr};
10+
11+
use super::node::{self, Handle, NodeRef, marker, InsertResult::*, ForceResult::*};
12+
use super::search::{self, SearchResult::*};
1913

2014
use UnderflowResult::*;
2115
use Entry::*;

src/liballoc/collections/btree/node.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,13 @@
3131
// - A node of length `n` has `n` keys, `n` values, and (in an internal node) `n + 1` edges.
3232
// This implies that even an empty internal node has at least one edge.
3333

34-
use core::{
35-
marker::PhantomData,
36-
mem::{self, MaybeUninit},
37-
ptr::{self, Unique, NonNull},
38-
slice,
39-
};
34+
use core::marker::PhantomData;
35+
use core::mem::{self, MaybeUninit};
36+
use core::ptr::{self, Unique, NonNull};
37+
use core::slice;
4038

41-
use crate::{
42-
alloc::{Global, Alloc, Layout},
43-
boxed::Box,
44-
};
39+
use crate::alloc::{Global, Alloc, Layout};
40+
use crate::boxed::Box;
4541

4642
const B: usize = 6;
4743
pub const MIN_LEN: usize = B - 1;

src/liballoc/collections/btree/search.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
use core::{
2-
borrow::Borrow,
3-
cmp::Ordering,
4-
};
1+
use core::borrow::Borrow;
2+
use core::cmp::Ordering;
53

64
use super::node::{Handle, NodeRef, marker, ForceResult::*};
75

0 commit comments

Comments
 (0)