Skip to content

Commit 383f8c8

Browse files
authored
[pointer] Group imports at the top of the file (#2407)
gherrit-pr-id: I0a3639a58c6161a41f9cbc200cd322cc136d77fd
1 parent 0d7c32c commit 383f8c8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/pointer/ptr.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66
// This file may not be copied, modified, or distributed except according to
77
// those terms.
88

9-
use core::{marker::PhantomData, ptr::NonNull};
9+
use core::{
10+
fmt::{Debug, Formatter},
11+
marker::PhantomData,
12+
ptr::NonNull,
13+
};
1014

1115
use super::{inner::PtrInner, invariant::*};
12-
use crate::{CastType, KnownLayout};
16+
use crate::{
17+
util::{AlignmentVariance, Covariant, TransparentWrapper, ValidityVariance},
18+
AlignmentError, CastError, CastType, KnownLayout, SizeError, TryFromBytes, ValidityError,
19+
};
1320

1421
/// Module used to gate access to [`Ptr`]'s fields.
1522
mod def {
@@ -131,7 +138,6 @@ pub use def::Ptr;
131138
/// External trait implementations on [`Ptr`].
132139
mod _external {
133140
use super::*;
134-
use core::fmt::{Debug, Formatter};
135141

136142
/// SAFETY: Shared pointers are safely `Copy`. `Ptr`'s other invariants
137143
/// (besides aliasing) are unaffected by the number of references that exist
@@ -172,7 +178,6 @@ mod _external {
172178
/// Methods for converting to and from `Ptr` and Rust's safe reference types.
173179
mod _conversions {
174180
use super::*;
175-
use crate::util::{AlignmentVariance, Covariant, TransparentWrapper, ValidityVariance};
176181

177182
/// `&'a T` → `Ptr<'a, T>`
178183
impl<'a, T> Ptr<'a, T, (Shared, Aligned, Valid)>
@@ -518,7 +523,6 @@ mod _conversions {
518523
/// State transitions between invariants.
519524
mod _transitions {
520525
use super::*;
521-
use crate::{AlignmentError, TryFromBytes, ValidityError};
522526

523527
impl<'a, T, I> Ptr<'a, T, I>
524528
where
@@ -829,7 +833,6 @@ mod _transitions {
829833
/// Casts of the referent type.
830834
mod _casts {
831835
use super::*;
832-
use crate::{CastError, SizeError};
833836

834837
impl<'a, T, I> Ptr<'a, T, I>
835838
where

0 commit comments

Comments
 (0)