Skip to content

Commit 53acf25

Browse files
committed
make fmt
1 parent f47c891 commit 53acf25

File tree

37 files changed

+135
-99
lines changed

37 files changed

+135
-99
lines changed

Diff for: git-diff/src/lines.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
use git_object::bstr::BStr;
2-
use similar::TextDiff;
3-
42
/// The crate powering file diffs.
53
pub use similar;
64
pub use similar::Algorithm;
5+
use similar::TextDiff;
76

87
/// Provide an iterator over the changes needed to turn `old` into `new` with `algorithm`.
98
///

Diff for: git-mailmap/src/snapshot/entry.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::snapshot::util::{EncodedString, EncodedStringRef};
21
use bstr::BString;
32

3+
use crate::snapshot::util::{EncodedString, EncodedStringRef};
4+
45
#[derive(Clone)]
56
pub(crate) struct NameEntry {
67
pub(crate) new_name: Option<BString>,

Diff for: git-mailmap/src/snapshot/signature.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use bstr::{BStr, BString, ByteSlice};
21
use std::borrow::Cow;
32

3+
use bstr::{BStr, BString, ByteSlice};
4+
45
/// A signature like [`git_actor::Signature`], but with all string fields being a `Cow`.
56
#[derive(Default, PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
67
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]

Diff for: git-mailmap/src/snapshot/util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use std::{cmp::Ordering, ops::Deref};
2+
13
use bstr::{BStr, BString, ByteSlice};
2-
use std::cmp::Ordering;
3-
use std::ops::Deref;
44

55
#[cfg_attr(test, derive(Debug))]
66
#[derive(Clone)]

Diff for: git-pack/src/bundle/write/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use std::io::Write;
21
use std::{
32
io,
3+
io::Write,
44
path::{Path, PathBuf},
55
sync::{atomic::AtomicBool, Arc},
66
};
@@ -14,10 +14,11 @@ mod error;
1414
pub use error::Error;
1515

1616
mod types;
17-
use crate::bundle::write::types::SharedTempFile;
1817
use types::{LockWriter, PassThrough};
1918
pub use types::{Options, Outcome};
2019

20+
use crate::bundle::write::types::SharedTempFile;
21+
2122
type ThinPackLookupFn = Box<dyn for<'a> FnMut(git_hash::ObjectId, &'a mut Vec<u8>) -> Option<git_object::Data<'a>>>;
2223
type ThinPackLookupFnSend =
2324
Box<dyn for<'a> FnMut(git_hash::ObjectId, &'a mut Vec<u8>) -> Option<git_object::Data<'a>> + Send + 'static>;

Diff for: git-ref/tests/file/worktree.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ mod read_only {
191191
}
192192

193193
mod writable {
194-
use git_lock::acquire::Fail;
195194
use std::convert::TryInto;
196195

196+
use git_lock::acquire::Fail;
197197
use git_ref::{
198198
file::{transaction::PackedRefs, Store},
199199
transaction::{Change, LogChange, PreviousValue, RefEdit},

Diff for: git-refspec/tests/spec/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
mod prefix {
2-
use git_refspec::parse::Operation;
3-
use git_refspec::RefSpec;
2+
use git_refspec::{parse::Operation, RefSpec};
43

54
#[test]
65
fn partial_refs_have_no_prefix() {

Diff for: git-repository/src/config/cache/access.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
use crate::config::Cache;
2-
use crate::{remote, repository::identity};
1+
use std::{convert::TryInto, path::PathBuf, time::Duration};
2+
33
use git_lock::acquire::Fail;
4-
use std::convert::TryInto;
5-
use std::path::PathBuf;
6-
use std::time::Duration;
4+
5+
use crate::{config::Cache, remote, repository::identity};
76

87
/// Access
98
impl Cache {

Diff for: git-repository/src/config/cache/util.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use std::convert::TryFrom;
22

33
use super::Error;
4-
use crate::bstr::ByteSlice;
5-
use crate::revision::spec::parse::ObjectKindHint;
4+
use crate::{bstr::ByteSlice, revision::spec::parse::ObjectKindHint};
65

76
pub(crate) fn interpolate_context<'a>(
87
git_install_dir: Option<&'a std::path::Path>,

Diff for: git-repository/src/config/snapshot/access.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use git_features::threading::OwnShared;
21
use std::borrow::Cow;
32

4-
use crate::config::{CommitAutoRollback, SnapshotMut};
3+
use git_features::threading::OwnShared;
4+
55
use crate::{
66
bstr::BStr,
7-
config::{cache::interpolate_context, Snapshot},
7+
config::{cache::interpolate_context, CommitAutoRollback, Snapshot, SnapshotMut},
88
};
99

1010
/// Access configuration values, frozen in time, using a `key` which is a `.` separated string of up to

Diff for: git-repository/src/object/tree/diff.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
use crate::bstr::{BStr, BString, ByteSlice, ByteVec};
2-
use crate::ext::ObjectIdExt;
3-
use crate::{Repository, Tree};
1+
use std::collections::VecDeque;
2+
43
use git_object::TreeRefIter;
54
use git_odb::FindExt;
6-
use std::collections::VecDeque;
5+
6+
use crate::{
7+
bstr::{BStr, BString, ByteSlice, ByteVec},
8+
ext::ObjectIdExt,
9+
Repository, Tree,
10+
};
711

812
/// The error return by methods on the [diff platform][Platform].
913
#[derive(Debug, thiserror::Error)]
@@ -43,10 +47,10 @@ pub struct Change<'a, 'old, 'new> {
4347

4448
///
4549
pub mod change {
46-
use crate::bstr::ByteSlice;
47-
use crate::Id;
4850
use git_object::tree::EntryMode;
4951

52+
use crate::{bstr::ByteSlice, Id};
53+
5054
/// An event emitted when finding differences between two trees.
5155
#[derive(Debug, Clone, Copy)]
5256
pub enum Event<'old, 'new> {

Diff for: git-repository/src/object/tree/traverse.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::Tree;
21
use git_odb::FindExt;
32

3+
use crate::Tree;
4+
45
/// Traversal
56
impl<'repo> Tree<'repo> {
67
/// Obtain a platform for initiating a variety of traversals.

Diff for: git-repository/src/remote/connect.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::{remote::Connection, Progress, Remote};
21
use git_protocol::transport::client::Transport;
32

3+
use crate::{remote::Connection, Progress, Remote};
4+
45
mod error {
56
use crate::{bstr::BString, remote};
67

Diff for: git-repository/src/remote/connection/fetch/config.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
use std::convert::TryInto;
2+
13
use super::Error;
24
use crate::Repository;
3-
use std::convert::TryInto;
45

56
pub fn index_threads(repo: &Repository) -> Result<Option<usize>, Error> {
67
let lenient_config = repo.options.lenient_config;

Diff for: git-repository/src/remote/connection/fetch/mod.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
use crate::remote::fetch::{DryRun, RefMap};
2-
use crate::remote::{fetch, ref_map, Connection};
3-
use crate::{remote, Progress};
1+
use std::sync::atomic::AtomicBool;
2+
43
use git_odb::FindExt;
54
use git_protocol::transport::client::Transport;
6-
use std::sync::atomic::AtomicBool;
5+
6+
use crate::{
7+
remote,
8+
remote::{
9+
fetch,
10+
fetch::{DryRun, RefMap},
11+
ref_map, Connection,
12+
},
13+
Progress,
14+
};
715

816
mod error {
917
/// The error returned by [`receive()`](super::Prepare::receive()).

Diff for: git-repository/src/remote/connection/fetch/update_refs/mod.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
use crate::ext::ObjectIdExt;
2-
use crate::remote::fetch;
3-
use crate::remote::fetch::refs::update::Mode;
4-
use crate::Repository;
1+
use std::{collections::BTreeMap, convert::TryInto, path::PathBuf};
2+
53
use git_odb::FindExt;
64
use git_pack::Find;
7-
use git_ref::transaction::{Change, LogChange, PreviousValue, RefEdit, RefLog};
8-
use git_ref::{Target, TargetRef};
9-
use std::collections::BTreeMap;
10-
use std::convert::TryInto;
11-
use std::path::PathBuf;
5+
use git_ref::{
6+
transaction::{Change, LogChange, PreviousValue, RefEdit, RefLog},
7+
Target, TargetRef,
8+
};
9+
10+
use crate::{
11+
ext::ObjectIdExt,
12+
remote::{fetch, fetch::refs::update::Mode},
13+
Repository,
14+
};
1215

1316
///
1417
pub mod update;

Diff for: git-repository/src/remote/connection/fetch/update_refs/tests.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
mod update {
2-
use crate as git;
32
use git_testtools::{hex_to_id, Result};
43

4+
use crate as git;
5+
56
fn base_repo_path() -> String {
67
git::path::realpath(
78
git_testtools::scripted_fixture_repo_read_only("make_remote_repos.sh")
@@ -28,9 +29,9 @@ mod update {
2829
let repo = git::open_opts(dir.path().join(name), git::open::Options::isolated()).unwrap();
2930
(repo, dir)
3031
}
32+
use git_ref::{transaction::Change, TargetRef};
33+
3134
use crate::remote::fetch;
32-
use git_ref::transaction::Change;
33-
use git_ref::TargetRef;
3435

3536
#[test]
3637
fn various_valid_updates() {

Diff for: git-repository/src/remote/connection/fetch/update_refs/update.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::remote::fetch;
21
use std::path::PathBuf;
32

3+
use crate::remote::fetch;
4+
45
mod error {
56
/// The error returned when updating references.
67
#[derive(Debug, thiserror::Error)]

Diff for: git-repository/src/remote/connection/ref_map.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
use crate::bstr::{BString, ByteVec};
1+
use std::collections::HashSet;
2+
23
use git_features::progress::Progress;
34
use git_protocol::transport::client::Transport;
4-
use std::collections::HashSet;
55

6-
use crate::remote::{connection::HandshakeWithRefs, fetch, Connection, Direction};
6+
use crate::{
7+
bstr::{BString, ByteVec},
8+
remote::{connection::HandshakeWithRefs, fetch, Connection, Direction},
9+
};
710

811
/// The error returned by [`Connection::ref_map()`].
912
#[derive(Debug, thiserror::Error)]

Diff for: git-repository/tests/object/tree.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
mod diff {
2-
use crate::named_repo;
3-
use git_object::bstr::ByteSlice;
4-
use git_object::tree::EntryMode;
2+
use std::convert::Infallible;
3+
4+
use git_object::{bstr::ByteSlice, tree::EntryMode};
55
use git_repository as git;
66
use git_repository::object::tree::diff::change::Event;
7-
use std::convert::Infallible;
7+
8+
use crate::named_repo;
89

910
#[test]
1011
fn changes_against_tree_modified() {

Diff for: git-repository/tests/remote/fetch.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#[cfg(feature = "blocking-network-client")]
22
mod blocking_io {
3-
use crate::remote;
3+
use std::sync::atomic::AtomicBool;
4+
45
use git_features::progress;
56
use git_repository as git;
6-
use git_repository::remote::fetch;
7-
use git_repository::remote::Direction::Fetch;
7+
use git_repository::remote::{fetch, Direction::Fetch};
88
use git_testtools::hex_to_id;
9-
use std::sync::atomic::AtomicBool;
9+
10+
use crate::remote;
1011

1112
fn repo_rw(name: &str) -> (git::Repository, git_testtools::tempfile::TempDir) {
1213
let dir = git_testtools::scripted_fixture_repo_writable_with_args(

Diff for: git-repository/tests/repository/object.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,11 @@ mod tag {
147147
}
148148

149149
mod commit {
150-
use crate::{freeze_time, restricted_and_git};
151150
use git_repository as git;
152151
use git_testtools::hex_to_id;
153152

153+
use crate::{freeze_time, restricted_and_git};
154+
154155
#[test]
155156
fn parent_in_initial_commit_causes_failure() {
156157
let tmp = tempfile::tempdir().unwrap();

Diff for: git-repository/tests/repository/remote.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,10 @@ mod find_remote {
273273
}
274274

275275
mod find_default_remote {
276-
use crate::remote;
277276
use git_repository as git;
278277

278+
use crate::remote;
279+
279280
#[test]
280281
fn works_on_detached_heads() -> crate::Result {
281282
let repo = remote::repo("detached-head");

Diff for: git-transport/src/client/blocking_io/file.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
use std::any::Any;
2-
use std::error::Error;
3-
use std::process::{self, Command, Stdio};
1+
use std::{
2+
any::Any,
3+
error::Error,
4+
process::{self, Command, Stdio},
5+
};
46

57
use bstr::{BString, ByteSlice};
68

Diff for: git-transport/src/client/blocking_io/http/curl/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::error::Error;
21
use std::{
2+
error::Error,
33
sync::mpsc::{Receiver, SyncSender},
44
thread,
55
};

Diff for: git-transport/src/client/blocking_io/http/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::any::Any;
21
use std::{
2+
any::Any,
33
borrow::Cow,
44
io::{BufRead, Read},
55
};

Diff for: git-transport/src/client/git/async_io.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
use std::error::Error;
2+
13
use async_trait::async_trait;
24
use bstr::BString;
35
use futures_io::{AsyncRead, AsyncWrite};
46
use futures_lite::AsyncWriteExt;
57
use git_packetline::PacketLineRef;
6-
use std::error::Error;
78

89
use crate::{
910
client::{self, capabilities, git, Capabilities, SetServiceResponse},

Diff for: git-transport/src/client/git/blocking_io.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use std::any::Any;
2-
use std::error::Error;
3-
use std::io::Write;
1+
use std::{any::Any, error::Error, io::Write};
42

53
use bstr::BString;
64
use git_packetline::PacketLineRef;

Diff for: git-transport/src/client/traits.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
use std::any::Any;
2-
use std::ops::{Deref, DerefMut};
1+
use std::{
2+
any::Any,
3+
ops::{Deref, DerefMut},
4+
};
35

46
#[cfg(any(feature = "blocking-client", feature = "async-client"))]
57
use crate::client::{MessageKind, RequestWriter, WriteMode};

Diff for: git-traverse/src/commit.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ impl Default for Sorting {
5454

5555
///
5656
pub mod ancestors {
57-
use std::borrow::Borrow;
58-
use std::{borrow::BorrowMut, collections::VecDeque, iter::FromIterator};
57+
use std::{
58+
borrow::{Borrow, BorrowMut},
59+
collections::VecDeque,
60+
iter::FromIterator,
61+
};
5962

6063
use git_hash::{oid, ObjectId};
6164
use git_object::CommitRefIter;

0 commit comments

Comments
 (0)