History

Apply nightly rustfmt rules.

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

Conor Davis committed 5 years ago

Commit 5e0edba1 parent 19f21a4275 files · +1173 −723Browse files

Showing the changes to git-commitgraph/src/file (5 of 275 files). Show all

Unified · Split

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