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 (8 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)] |
| @@ -1,13 +1,14 @@ | ||
| 1 | −use crate::{ | |
| 2 | − file::{self, File}, | |
| 3 | − Graph, MAX_COMMITS, | |
| 4 | −}; | |
| 5 | 1 | use std::{ |
| 6 | 2 | convert::TryFrom, |
| 7 | 3 | io::{BufRead, BufReader}, |
| 8 | 4 | path::{Path, PathBuf}, |
| 9 | 5 | }; |
| 10 | 6 | |
| 7 | +use crate::{ | |
| 8 | + file::{self, File}, | |
| 9 | + Graph, MAX_COMMITS, | |
| 10 | +}; | |
| 11 | + | |
| 11 | 12 | /// The error used in the [`graph`][crate::graph] module. |
| 12 | 13 | #[derive(thiserror::Error, Debug)] |
| 13 | 14 | #[allow(missing_docs)] |
| @@ -3,9 +3,10 @@ mod access; · 2 unmodified lines | ||
| 3 | 3 | mod init; |
| 4 | 4 | pub mod verify; |
| 5 | 5 | |
| 6 | −use crate::file::File; | |
| 7 | 6 | use std::fmt; |
| 8 | 7 | |
| 8 | +use crate::file::File; | |
| 9 | + | |
| 9 | 10 | /// A complete commit graph. |
| 10 | 11 | /// |
| 11 | 12 | /// The data in the commit graph may come from a monolithic `objects/info/commit-graph` file, or it |
| @@ -1,8 +1,4 @@ | ||
| 1 | 1 | //! Auxiliary types used by graph verification methods. |
| 2 | −use crate::{ | |
| 3 | − file::{self, commit}, | |
| 4 | − graph, Graph, GENERATION_NUMBER_MAX, | |
| 5 | −}; | |
| 6 | 2 | use std::{ |
| 7 | 3 | cmp::{max, min}, |
| 8 | 4 | collections::BTreeMap, |
| @@ -10,6 +6,11 @@ use std::{ · 1 unmodified line | ||
| 10 | 6 | path::PathBuf, |
| 11 | 7 | }; |
| 12 | 8 | |
| 9 | +use crate::{ | |
| 10 | + file::{self, commit}, | |
| 11 | + graph, Graph, GENERATION_NUMBER_MAX, | |
| 12 | +}; | |
| 13 | + | |
| 13 | 14 | /// The error used in [`verify_integrity()`][Graph::verify_integrity]. |
| 14 | 15 | #[derive(thiserror::Error, Debug)] |
| 15 | 16 | #[allow(missing_docs)] |