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 (8 of 275 files). Show all

Unified · Split

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