Applied via `make rustfmt`, which enables these nightly-only rules: ``` group_imports = "StdExternalCrate" imports_granularity = "Crate" ``` Keep git-config in its original form for now
Showing the changes to git-commitgraph/src/file (5 of 275 files). Show all
Unified · Split
| @@ -1,11 +1,13 @@ | ||
| 1 | −use crate::file::{self, commit::Commit, File, COMMIT_DATA_ENTRY_SIZE}; | |
| 2 | −use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | |
| 3 | 1 | use std::{ |
| 4 | 2 | convert::TryInto, |
| 5 | 3 | fmt::{Debug, Formatter}, |
| 6 | 4 | path::Path, |
| 7 | 5 | }; |
| 8 | 6 | |
| 7 | +use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | |
| 8 | + | |
| 9 | +use crate::file::{self, commit::Commit, File, COMMIT_DATA_ENTRY_SIZE}; | |
| 10 | + | |
| 9 | 11 | /// Access |
| 10 | 12 | impl File { |
| 11 | 13 | /// The number of base graphs that this file depends on. |
| @@ -1,16 +1,18 @@ | ||
| 1 | 1 | //! Low-level operations on individual commits. |
| 2 | −use crate::{ | |
| 3 | − file::{self, File}, | |
| 4 | − graph, | |
| 5 | −}; | |
| 6 | −use byteorder::{BigEndian, ByteOrder}; | |
| 7 | −use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | |
| 8 | 2 | use std::{ |
| 9 | 3 | convert::TryInto, |
| 10 | 4 | fmt::{Debug, Formatter}, |
| 11 | 5 | slice::Chunks, |
| 12 | 6 | }; |
| 13 | 7 | |
| 8 | +use byteorder::{BigEndian, ByteOrder}; | |
| 9 | +use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | |
| 10 | + | |
| 11 | +use crate::{ | |
| 12 | + file::{self, File}, | |
| 13 | + graph, | |
| 14 | +}; | |
| 15 | + | |
| 14 | 16 | /// The error used in the [`file::commit`][self] module. |
| 15 | 17 | #[derive(thiserror::Error, Debug)] |
| 16 | 18 | #[allow(missing_docs)] |
| @@ -1,14 +1,16 @@ | ||
| 1 | −use crate::file::{File, COMMIT_DATA_ENTRY_SIZE, FAN_LEN, SIGNATURE}; | |
| 2 | −use bstr::ByteSlice; | |
| 3 | −use byteorder::{BigEndian, ByteOrder}; | |
| 4 | −use filebuffer::FileBuffer; | |
| 5 | −use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | |
| 6 | 1 | use std::{ |
| 7 | 2 | convert::{TryFrom, TryInto}, |
| 8 | 3 | ops::Range, |
| 9 | 4 | path::Path, |
| 10 | 5 | }; |
| 11 | 6 | |
| 7 | +use bstr::ByteSlice; | |
| 8 | +use byteorder::{BigEndian, ByteOrder}; | |
| 9 | +use filebuffer::FileBuffer; | |
| 10 | +use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | |
| 11 | + | |
| 12 | +use crate::file::{File, COMMIT_DATA_ENTRY_SIZE, FAN_LEN, SIGNATURE}; | |
| 13 | + | |
| 12 | 14 | type ChunkId = [u8; 4]; |
| 13 | 15 | |
| 14 | 16 | /// The error used in [`File::at()`]. |
| @@ -8,16 +8,16 @@ pub use commit::Commit; · 7 unmodified lines | ||
| 8 | 8 | mod init; |
| 9 | 9 | pub mod verify; |
| 10 | 10 | |
| 11 | −pub use init::Error; | |
| 12 | − | |
| 13 | −use filebuffer::FileBuffer; | |
| 14 | −use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | |
| 15 | 11 | use std::{ |
| 16 | 12 | fmt::{Display, Formatter}, |
| 17 | 13 | ops::Range, |
| 18 | 14 | path::PathBuf, |
| 19 | 15 | }; |
| 20 | 16 | |
| 17 | +use filebuffer::FileBuffer; | |
| 18 | +use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | |
| 19 | +pub use init::Error; | |
| 20 | + | |
| 21 | 21 | const COMMIT_DATA_ENTRY_SIZE: usize = SHA1_SIZE + 16; |
| 22 | 22 | const FAN_LEN: usize = 256; |
| 23 | 23 | const SIGNATURE: &[u8] = b"CGPH"; |
| @@ -1,16 +1,18 @@ | ||
| 1 | 1 | //! Auxiliary types used in commit graph file verification methods. |
| 2 | −use crate::{ | |
| 3 | − file::{self, File}, | |
| 4 | − GENERATION_NUMBER_INFINITY, GENERATION_NUMBER_MAX, | |
| 5 | −}; | |
| 6 | −use bstr::ByteSlice; | |
| 7 | −use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | |
| 8 | 2 | use std::{ |
| 9 | 3 | cmp::{max, min}, |
| 10 | 4 | collections::HashMap, |
| 11 | 5 | path::Path, |
| 12 | 6 | }; |
| 13 | 7 | |
| 8 | +use bstr::ByteSlice; | |
| 9 | +use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; | |
| 10 | + | |
| 11 | +use crate::{ | |
| 12 | + file::{self, File}, | |
| 13 | + GENERATION_NUMBER_INFINITY, GENERATION_NUMBER_MAX, | |
| 14 | +}; | |
| 15 | + | |
| 14 | 16 | /// The error used in [`File::traverse()`]. |
| 15 | 17 | #[derive(thiserror::Error, Debug)] |
| 16 | 18 | #[allow(missing_docs)] |