Skip to content

Commit

Permalink
Group use clauses consistently within the entire crate.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinFinck committed Jun 13, 2023
1 parent 509b1d6 commit 206a369
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/file_reference.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright 2021-2023 Colin Finck <colin@reactos.org>
// SPDX-License-Identifier: MIT OR Apache-2.0

use binrw::io::{Read, Seek};
use binrw::BinRead;

use crate::error::Result;
use crate::file::NtfsFile;
use crate::ntfs::Ntfs;
use binrw::io::{Read, Seek};
use binrw::BinRead;

/// Absolute reference to a File Record on the filesystem, composed out of a File Record Number and a Sequence Number.
///
Expand Down
3 changes: 2 additions & 1 deletion src/guid.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright 2021-2023 Colin Finck <colin@reactos.org>
// SPDX-License-Identifier: MIT OR Apache-2.0

use binrw::BinRead;
use core::fmt;

use binrw::BinRead;

/// Size of a single GUID on disk (= size of all GUID fields).
pub(crate) const GUID_SIZE: usize = 16;

Expand Down
3 changes: 2 additions & 1 deletion src/index_record.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Copyright 2021-2023 Colin Finck <colin@reactos.org>
// SPDX-License-Identifier: MIT OR Apache-2.0

use core::ops::Range;

use alloc::vec;
use binrw::io::{Read, Seek};
use byteorder::{ByteOrder, LittleEndian};
use core::ops::Range;
use memoffset::offset_of;

use crate::attribute_value::NtfsAttributeValue;
Expand Down
3 changes: 2 additions & 1 deletion src/indexes/file_name.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Copyright 2021-2023 Colin Finck <colin@reactos.org>
// SPDX-License-Identifier: MIT OR Apache-2.0

use binrw::io::{Read, Seek};

use crate::error::Result;
use crate::index::NtfsIndexFinder;
use crate::index_entry::NtfsIndexEntry;
use crate::indexes::{NtfsIndexEntryHasFileReference, NtfsIndexEntryType};
use crate::ntfs::Ntfs;
use crate::structured_values::NtfsFileName;
use crate::upcase_table::UpcaseOrd;
use binrw::io::{Read, Seek};

/// Defines the [`NtfsIndexEntryType`] for filename indexes (commonly known as "directories").
#[derive(Clone, Copy, Debug)]
Expand Down
6 changes: 4 additions & 2 deletions src/structured_values/index_allocation.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Copyright 2021-2023 Colin Finck <colin@reactos.org>
// SPDX-License-Identifier: MIT OR Apache-2.0

use core::iter::FusedIterator;

use binrw::io::{Read, Seek, SeekFrom};

use crate::attribute::NtfsAttributeType;
use crate::attribute_value::NtfsAttributeValue;
use crate::error::{NtfsError, Result};
Expand All @@ -9,8 +13,6 @@ use crate::ntfs::Ntfs;
use crate::structured_values::NtfsStructuredValue;
use crate::traits::NtfsReadSeek;
use crate::types::Vcn;
use binrw::io::{Read, Seek, SeekFrom};
use core::iter::FusedIterator;

/// Structure of an $INDEX_ALLOCATION attribute.
///
Expand Down
5 changes: 3 additions & 2 deletions src/structured_values/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ pub use standard_information::*;
pub use volume_information::*;
pub use volume_name::*;

use binrw::io::{Read, Seek};
use bitflags::bitflags;

use crate::attribute::NtfsAttributeType;
use crate::attribute_value::{NtfsAttributeValue, NtfsResidentAttributeValue};
use crate::error::Result;
use binrw::io::{Read, Seek};
use bitflags::bitflags;

bitflags! {
/// Flags that a user can set for a file (Read-Only, Hidden, System, Archive, etc.).
Expand Down
3 changes: 2 additions & 1 deletion src/traits.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Copyright 2021-2023 Colin Finck <colin@reactos.org>
// SPDX-License-Identifier: MIT OR Apache-2.0

use crate::error::{NtfsError, Result};
use binrw::io;
use binrw::io::{Read, Seek, SeekFrom};

use crate::error::{NtfsError, Result};

/// Trait to read/seek in a source by the help of a temporarily passed mutable reference to the filesystem reader.
///
/// By requiring the user to pass the filesystem reader on every read, we circumvent the problems associated with permanently
Expand Down

0 comments on commit 206a369

Please sign in to comment.