Skip to content

Commit 4b320e7

Browse files
committed
make fmt (#427)
1 parent e972aad commit 4b320e7

File tree

45 files changed

+165
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+165
-122
lines changed

git-attributes/src/match_group.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
use crate::{Assignment, MatchGroup, PatternList, PatternMapping};
2-
use bstr::{BStr, BString, ByteSlice, ByteVec};
31
use std::{
42
ffi::OsString,
53
io::Read,
64
path::{Path, PathBuf},
75
};
86

7+
use bstr::{BStr, BString, ByteSlice, ByteVec};
8+
9+
use crate::{Assignment, MatchGroup, PatternList, PatternMapping};
10+
911
fn into_owned_assignments<'a>(
1012
attrs: impl Iterator<Item = Result<crate::AssignmentRef<'a>, crate::name::Error>>,
1113
) -> Result<Vec<Assignment>, crate::name::Error> {

git-attributes/src/name.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::{Name, NameRef};
21
use bstr::BString;
32

3+
use crate::{Name, NameRef};
4+
45
impl<'a> NameRef<'a> {
56
/// Turn this ref into its owned counterpart.
67
pub fn to_owned(self) -> Name {

git-attributes/src/parse/attribute.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
use crate::{name, AssignmentRef, Name, NameRef, StateRef};
2-
use bstr::{BStr, ByteSlice};
31
use std::borrow::Cow;
42

3+
use bstr::{BStr, ByteSlice};
4+
5+
use crate::{name, AssignmentRef, Name, NameRef, StateRef};
6+
57
/// The kind of attribute that was parsed.
68
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
79
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]

git-attributes/src/state.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::{State, StateRef};
21
use bstr::ByteSlice;
32

3+
use crate::{State, StateRef};
4+
45
impl<'a> StateRef<'a> {
56
/// Turn ourselves into our owned counterpart.
67
pub fn to_owned(self) -> State {

git-date/src/time.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use bstr::BString;
21
use std::{convert::TryInto, io, ops::Sub};
32

3+
use bstr::BString;
4+
45
use crate::Time;
56

67
/// Indicates if a number is positive or negative for use in [`Time`].

git-discover/src/upwards.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ mod parse_ceiling_dirs {
117117
#[test]
118118
#[cfg(unix)]
119119
fn from_environment_format() -> std::io::Result<()> {
120-
use super::*;
121120
use std::{fs, os::unix::fs::symlink};
122121

122+
use super::*;
123+
123124
// Setup filesystem
124125
let dir = tempfile::tempdir().expect("success creating temp dir");
125126
let direct_path = dir.path().join("direct");

git-features/src/fs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ pub fn open_options_no_follow() -> std::fs::OpenOptions {
7272
}
7373

7474
mod snapshot {
75-
use crate::threading::{get_mut, get_ref, MutableOnDemand, OwnShared};
7675
use std::ops::Deref;
7776

77+
use crate::threading::{get_mut, get_ref, MutableOnDemand, OwnShared};
78+
7879
/// A structure holding enough information to reload a value if its on-disk representation changes as determined by its modified time.
7980
#[derive(Debug)]
8081
pub struct Snapshot<T: std::fmt::Debug> {

git-index/src/write.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
use crate::{extension, State, Version};
2-
use bstr::ByteVec;
31
use std::{
42
collections::{hash_map, HashMap},
53
ops::Range,
64
};
75

6+
use bstr::ByteVec;
7+
8+
use crate::{extension, State, Version};
9+
810
impl State {
911
pub fn write_to(&self, options: Options) -> Vec<u8> {
1012
let mut writer = Writer::new(self, options);

git-odb/src/store_impls/dynamic/find.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::collections::HashSet;
2-
use std::{convert::TryInto, ops::Deref};
1+
use std::{collections::HashSet, convert::TryInto, ops::Deref};
32

43
use git_hash::{oid, ObjectId};
54
use git_pack::{cache::DecodeEntry, data::entry::Location};

git-odb/src/store_impls/dynamic/handle.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ pub struct IndexForObjectInPack {
6969
}
7070

7171
pub(crate) mod index_lookup {
72-
use std::collections::HashSet;
73-
use std::sync::Arc;
72+
use std::{collections::HashSet, sync::Arc};
7473

7574
use git_hash::oid;
7675

git-odb/src/store_impls/loose/find.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::collections::HashSet;
2-
use std::{cmp::Ordering, fs, io::Read, path::PathBuf};
1+
use std::{cmp::Ordering, collections::HashSet, fs, io::Read, path::PathBuf};
32

43
use git_features::zlib;
54

git-odb/tests/odb/store/dynamic.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,10 @@ mod disambiguate_prefix {
553553
}
554554

555555
mod lookup_prefix {
556+
use std::collections::HashSet;
557+
556558
use git_testtools::hex_to_id;
557559
use maplit::hashset;
558-
use std::collections::HashSet;
559560

560561
use crate::store::dynamic::{assert_all_indices_loaded, db_with_all_object_sources};
561562

git-odb/tests/odb/store/loose.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ mod contains {
8585
}
8686

8787
mod lookup_prefix {
88+
use std::collections::HashSet;
89+
8890
use git_testtools::{fixture_path, hex_to_id};
8991
use maplit::hashset;
90-
use std::collections::HashSet;
9192

9293
use crate::store::loose::ldb;
9394

git-pack/src/index/access.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::mem::size_of;
2-
use std::ops::Range;
1+
use std::{mem::size_of, ops::Range};
32

43
use crate::{
54
data,

git-pack/src/multi_index/access.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
use std::ops::Range;
2-
use std::path::{Path, PathBuf};
1+
use std::{
2+
ops::Range,
3+
path::{Path, PathBuf},
4+
};
35

46
use crate::{
57
data,

git-pathspec/src/parse.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
use crate::{MagicSignature, MatchMode, Pattern};
2-
use bstr::{BStr, BString, ByteSlice, ByteVec};
31
use std::borrow::Cow;
42

3+
use bstr::{BStr, BString, ByteSlice, ByteVec};
4+
5+
use crate::{MagicSignature, MatchMode, Pattern};
6+
57
/// The error returned by [parse()][crate::parse()].
68
#[derive(thiserror::Error, Debug)]
79
#[allow(missing_docs)]

git-pathspec/tests/pathspec.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
pub use git_testtools::Result;
22

33
mod parse {
4+
use std::collections::HashMap;
5+
46
use bstr::{BStr, BString, ByteSlice};
57
use git_attributes::State;
68
use git_pathspec::{MagicSignature, MatchMode, Pattern};
79
use once_cell::sync::Lazy;
8-
use std::collections::HashMap;
910

1011
#[derive(Debug, Clone, PartialEq, Eq)]
1112
struct PatternForTesting {
@@ -59,12 +60,13 @@ mod parse {
5960
}
6061

6162
mod succeed {
63+
use git_attributes::State;
64+
use git_pathspec::{MagicSignature, MatchMode};
65+
6266
use crate::parse::{
6367
check_valid_inputs, pat, pat_with_attrs, pat_with_path, pat_with_path_and_sig, pat_with_search_mode,
6468
pat_with_sig,
6569
};
66-
use git_attributes::State;
67-
use git_pathspec::{MagicSignature, MatchMode};
6870

6971
#[test]
7072
fn there_is_no_pathspec_pathspec() {
@@ -256,9 +258,10 @@ mod parse {
256258
}
257259

258260
mod fail {
259-
use crate::parse::check_against_baseline;
260261
use git_pathspec::parse::Error;
261262

263+
use crate::parse::check_against_baseline;
264+
262265
#[test]
263266
fn empty_input() {
264267
let input = "";

git-ref/src/store/file/transaction/prepare.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ mod error {
432432
}
433433
}
434434

435-
use crate::packed::transaction::buffer_into_transaction;
436435
pub use error::Error;
437436

438-
use crate::transaction::PreviousValue;
437+
use crate::{packed::transaction::buffer_into_transaction, transaction::PreviousValue};

git-repository/src/config/cache.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ use std::{convert::TryFrom, path::PathBuf};
33
use git_config::{Boolean, Integer};
44

55
use super::{Cache, Error};
6-
use crate::revision::spec::parse::ObjectKindHint;
7-
use crate::{bstr::ByteSlice, repository, repository::identity};
6+
use crate::{bstr::ByteSlice, repository, repository::identity, revision::spec::parse::ObjectKindHint};
87

98
/// A utility to deal with the cyclic dependency between the ref store and the configuration. The ref-store needs the
109
/// object hash kind, and the configuration needs the current branch name to resolve conditional includes with `onbranch`.

git-repository/src/config/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
pub use git_config::*;
22
use git_features::threading::OnceCell;
33

4-
use crate::revision::spec;
5-
use crate::{bstr::BString, permission, repository::identity, Repository};
4+
use crate::{bstr::BString, permission, repository::identity, revision::spec, Repository};
65

76
pub(crate) mod cache;
87
mod snapshot;

git-repository/src/head.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,14 @@ impl<'repo> Head<'repo> {
8383
}
8484
///
8585
pub mod log {
86-
use crate::bstr::{BString, ByteSlice};
87-
use git_hash::ObjectId;
8886
use std::convert::TryInto;
8987

90-
use crate::Head;
88+
use git_hash::ObjectId;
89+
90+
use crate::{
91+
bstr::{BString, ByteSlice},
92+
Head,
93+
};
9194

9295
impl<'repo> Head<'repo> {
9396
/// Return a platform for obtaining iterators on the reference log associated with the `HEAD` reference.

git-repository/src/repository/location.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use git_path::realpath::MAX_SYMLINKS;
21
use std::path::PathBuf;
32

3+
use git_path::realpath::MAX_SYMLINKS;
4+
45
impl crate::Repository {
56
/// Return the path to the repository itself, containing objects, references, configuration, and more.
67
///

git-repository/src/repository/revision.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use crate::bstr::BStr;
2-
use crate::revision;
1+
use crate::{bstr::BStr, revision};
32

43
/// Methods for resolving revisions by spec or working with the commit graph.
54
impl crate::Repository {

git-repository/src/revision/spec/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
use crate::ext::ReferenceExt;
2-
use crate::{revision::Spec, Id, Reference};
1+
use crate::{ext::ReferenceExt, revision::Spec, Id, Reference};
32

43
///
54
pub mod parse;
65

76
mod impls {
8-
use crate::revision::Spec;
97
use std::ops::{Deref, DerefMut};
108

9+
use crate::revision::Spec;
10+
1111
impl<'repo> Deref for Spec<'repo> {
1212
type Target = git_revision::Spec;
1313

git-repository/src/revision/spec/parse/delegate/mod.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
use super::{Delegate, Error, ObjectKindHint};
2-
use crate::ext::{ObjectIdExt, ReferenceExt};
3-
use crate::Repository;
1+
use std::collections::HashSet;
2+
43
use git_hash::ObjectId;
5-
use git_revision::spec::parse;
6-
use git_revision::spec::parse::delegate::{self};
4+
use git_revision::spec::{
5+
parse,
6+
parse::delegate::{self},
7+
};
78
use smallvec::SmallVec;
8-
use std::collections::HashSet;
9+
10+
use super::{Delegate, Error, ObjectKindHint};
11+
use crate::{
12+
ext::{ObjectIdExt, ReferenceExt},
13+
Repository,
14+
};
915

1016
type Replacements = SmallVec<[(ObjectId, ObjectId); 1]>;
1117

git-repository/src/revision/spec/parse/delegate/navigate.rs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
use crate::bstr::{BStr, ByteSlice};
2-
use crate::ext::ObjectIdExt;
3-
use crate::object;
4-
use crate::revision::spec::parse::delegate::{handle_errors_and_replacements, peel};
5-
use crate::revision::spec::parse::Delegate;
6-
use crate::revision::spec::parse::{delegate::Replacements, Error};
1+
use std::collections::HashSet;
2+
73
use git_hash::ObjectId;
8-
use git_revision::spec::parse::delegate;
9-
use git_revision::spec::parse::delegate::{PeelTo, Traversal};
4+
use git_revision::spec::parse::{
5+
delegate,
6+
delegate::{PeelTo, Traversal},
7+
};
108
use git_traverse::commit::Sorting;
11-
use std::collections::HashSet;
9+
10+
use crate::{
11+
bstr::{BStr, ByteSlice},
12+
ext::ObjectIdExt,
13+
object,
14+
revision::spec::parse::{
15+
delegate::{handle_errors_and_replacements, peel, Replacements},
16+
Delegate, Error,
17+
},
18+
};
1219

1320
impl<'repo> delegate::Navigate for Delegate<'repo> {
1421
fn traverse(&mut self, kind: Traversal) -> Option<()> {

git-repository/src/revision/spec/parse/delegate/revision.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
use crate::bstr::{BStr, BString, ByteSlice};
2-
use crate::ext::ReferenceExt;
3-
use crate::object;
4-
use crate::revision::spec::parse::{Delegate, Error, RefsHint};
5-
use git_hash::ObjectId;
6-
use git_revision::spec::parse::delegate;
7-
use git_revision::spec::parse::delegate::{ReflogLookup, SiblingBranch};
81
use std::collections::HashSet;
92

3+
use git_hash::ObjectId;
4+
use git_revision::spec::parse::{
5+
delegate,
6+
delegate::{ReflogLookup, SiblingBranch},
7+
};
8+
9+
use crate::{
10+
bstr::{BStr, BString, ByteSlice},
11+
ext::ReferenceExt,
12+
object,
13+
revision::spec::parse::{Delegate, Error, RefsHint},
14+
};
15+
1016
impl<'repo> delegate::Revision for Delegate<'repo> {
1117
fn find_ref(&mut self, name: &BStr) -> Option<()> {
1218
self.unset_disambiguate_call();

git-repository/src/revision/spec/parse/error.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use super::Error;
2-
use crate::bstr::BString;
3-
use crate::ext::ObjectIdExt;
4-
use crate::{bstr, Repository};
5-
use git_hash::ObjectId;
61
use std::collections::HashSet;
72

3+
use git_hash::ObjectId;
4+
5+
use super::Error;
6+
use crate::{bstr, bstr::BString, ext::ObjectIdExt, Repository};
7+
88
/// Additional information about candidates that caused ambiguity.
99
#[derive(Debug)]
1010
pub enum CandidateInfo {

0 commit comments

Comments
 (0)