Skip to content

Commit 50ff7aa

Browse files
committed
make fmt (#301)
1 parent 04ca834 commit 50ff7aa

File tree

15 files changed

+64
-57
lines changed

15 files changed

+64
-57
lines changed

Diff for: git-actor/src/signature/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
mod _ref {
2-
use crate::{signature::decode, Signature, SignatureRef};
32
use bstr::ByteSlice;
43

4+
use crate::{signature::decode, Signature, SignatureRef};
5+
56
impl<'a> SignatureRef<'a> {
67
/// Deserialize a signature from the given `data`.
78
pub fn from_bytes<E>(data: &'a [u8]) -> Result<SignatureRef<'a>, nom::Err<E>>

Diff for: git-attributes/tests/parse/ignore.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use bstr::BString;
2-
use git_glob::pattern::Mode;
3-
use git_glob::Pattern;
2+
use git_glob::{pattern::Mode, Pattern};
43
use git_testtools::fixture_bytes;
54

65
#[test]

Diff for: git-config/src/values.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Rust containers for valid `git-config` types.
22
3-
use bstr::BStr;
43
use std::{borrow::Cow, convert::TryFrom, fmt::Display, str::FromStr};
54

5+
use bstr::BStr;
66
use quick_error::quick_error;
77
#[cfg(feature = "serde")]
88
use serde::{Serialize, Serializer};

Diff for: git-config/tests/integration_tests/git_config_integration_tests.rs

+31-27
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#[cfg(test)]
22
mod mutable_value {
3-
use git_config::file::GitConfig;
43
use std::convert::TryFrom;
54

5+
use git_config::file::GitConfig;
6+
67
fn init_config() -> GitConfig<'static> {
78
GitConfig::try_from(
89
r#"[core]
@@ -137,9 +138,10 @@ b
137138

138139
#[cfg(test)]
139140
mod mutable_multi_value {
140-
use git_config::file::GitConfig;
141141
use std::{borrow::Cow, convert::TryFrom};
142142

143+
use git_config::file::GitConfig;
144+
143145
fn init_config() -> GitConfig<'static> {
144146
GitConfig::try_from(
145147
r#"[core]
@@ -277,13 +279,12 @@ a"#,
277279

278280
#[cfg(test)]
279281
mod from_paths_tests {
280-
use std::borrow::Cow;
281-
use std::path::Path;
282-
use std::{fs, io};
282+
use std::{borrow::Cow, fs, io, path::Path};
283283

284-
use git_config::file::from_paths::Error;
285-
use git_config::file::{from_paths, GitConfig};
286-
use git_config::parser::ParserOrIoError;
284+
use git_config::{
285+
file::{from_paths, from_paths::Error, GitConfig},
286+
parser::ParserOrIoError,
287+
};
287288
use tempfile::tempdir;
288289

289290
/// Escapes backslash when writing a path as string so that it is a valid windows path
@@ -749,12 +750,9 @@ mod from_paths_tests {
749750

750751
#[cfg(test)]
751752
mod from_env_tests {
752-
use std::borrow::Cow;
753-
use std::{env, fs};
753+
use std::{borrow::Cow, env, fs};
754754

755-
use git_config::file::from_paths::Options;
756-
use git_config::file::GitConfig;
757-
use git_config::file::{from_env, from_paths};
755+
use git_config::file::{from_env, from_paths, from_paths::Options, GitConfig};
758756
use serial_test::serial;
759757
use tempfile::tempdir;
760758

@@ -892,10 +890,12 @@ mod from_env_tests {
892890

893891
#[cfg(test)]
894892
mod get_raw_value {
895-
use git_config::file::{GitConfig, GitConfigError};
896-
use git_config::parser::SectionHeaderName;
897-
use std::borrow::Cow;
898-
use std::convert::TryFrom;
893+
use std::{borrow::Cow, convert::TryFrom};
894+
895+
use git_config::{
896+
file::{GitConfig, GitConfigError},
897+
parser::SectionHeaderName,
898+
};
899899

900900
#[test]
901901
fn single_section() {
@@ -956,11 +956,12 @@ mod get_raw_value {
956956

957957
#[cfg(test)]
958958
mod get_value {
959-
use git_config::file::GitConfig;
960-
use git_config::values::{Boolean, Bytes, TrueVariant};
961-
use std::borrow::Cow;
962-
use std::convert::TryFrom;
963-
use std::error::Error;
959+
use std::{borrow::Cow, convert::TryFrom, error::Error};
960+
961+
use git_config::{
962+
file::GitConfig,
963+
values::{Boolean, Bytes, TrueVariant},
964+
};
964965

965966
#[test]
966967
fn single_section() -> Result<(), Box<dyn Error>> {
@@ -1005,10 +1006,12 @@ mod get_value {
10051006

10061007
#[cfg(test)]
10071008
mod get_raw_multi_value {
1008-
use git_config::file::{GitConfig, GitConfigError};
1009-
use git_config::parser::SectionHeaderName;
1010-
use std::borrow::Cow;
1011-
use std::convert::TryFrom;
1009+
use std::{borrow::Cow, convert::TryFrom};
1010+
1011+
use git_config::{
1012+
file::{GitConfig, GitConfigError},
1013+
parser::SectionHeaderName,
1014+
};
10121015

10131016
#[test]
10141017
fn single_value_is_identical_to_single_value_query() {
@@ -1089,9 +1092,10 @@ mod get_raw_multi_value {
10891092

10901093
#[cfg(test)]
10911094
mod display {
1092-
use git_config::file::GitConfig;
10931095
use std::convert::TryFrom;
10941096

1097+
use git_config::file::GitConfig;
1098+
10951099
#[test]
10961100
fn can_reconstruct_empty_config() {
10971101
let config = r#"

Diff for: git-odb/tests/odb/store/compound.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ fn db() -> git_odb::Handle {
99
}
1010

1111
mod locate {
12-
use crate::{hex_to_id, odb::store::compound::db};
1312
use git_odb::Find;
1413

14+
use crate::{hex_to_id, odb::store::compound::db};
15+
1516
fn can_locate(db: &git_odb::Handle, hex_id: &str) {
1617
let mut buf = vec![];
1718
assert!(db

Diff for: git-odb/tests/odb/store/dynamic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use git_hash::ObjectId;
21
use std::process::Command;
32

3+
use git_hash::ObjectId;
44
use git_odb::{store, Find, FindExt, Write};
55
use git_testtools::{fixture_path, hex_to_id};
66

Diff for: git-odb/tests/odb/store/linked.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ mod locate {
5757
}
5858

5959
mod init {
60-
use crate::odb::{alternate::alternate, store::linked::db};
6160
use git_hash::ObjectId;
6261
use git_odb::Find;
6362

63+
use crate::odb::{alternate::alternate, store::linked::db};
64+
6465
#[test]
6566
fn multiple_linked_repositories_via_alternates() -> crate::Result {
6667
let tmp = git_testtools::tempfile::TempDir::new()?;

Diff for: git-ref/tests/fullname/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use git_ref::Category;
21
use std::convert::TryInto;
32

3+
use git_ref::Category;
4+
45
#[test]
56
fn file_name() {
67
let name: git_ref::FullName = "refs/heads/main".try_into().unwrap();

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ pub enum Error {
1717

1818
///
1919
pub mod describe {
20-
use crate::bstr::BStr;
21-
use crate::ext::ObjectIdExt;
22-
use crate::Repository;
20+
use std::borrow::Cow;
21+
2322
use git_hash::ObjectId;
2423
use git_odb::Find;
25-
use std::borrow::Cow;
24+
25+
use crate::{bstr::BStr, ext::ObjectIdExt, Repository};
2626

2727
/// The result of [try_resolve()][Platform::try_resolve()].
2828
pub struct Resolution<'repo> {

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

+8-5
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ pub(crate) struct Cache {
3030
}
3131

3232
mod cache {
33+
use std::{borrow::Cow, convert::TryFrom};
34+
35+
use git_config::{
36+
file::GitConfig,
37+
values,
38+
values::{Boolean, Integer},
39+
};
40+
3341
use super::{Cache, Error};
3442
use crate::bstr::ByteSlice;
35-
use git_config::file::GitConfig;
36-
use git_config::values;
37-
use git_config::values::{Boolean, Integer};
38-
use std::borrow::Cow;
39-
use std::convert::TryFrom;
4043

4144
impl Cache {
4245
pub fn new(git_dir: &std::path::Path) -> Result<Self, Error> {

Diff for: git-repository/src/object/commit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ mod error {
1818
}
1919
}
2020

21-
use crate::id::Ancestors;
22-
2321
pub use error::Error;
2422

23+
use crate::id::Ancestors;
24+
2525
impl<'repo> Commit<'repo> {
2626
/// Create an owned instance of this object, copying our data in the process.
2727
pub fn detached(&self) -> DetachedObject {

Diff for: git-repository/src/object/tag.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use crate::ext::ObjectIdExt;
2-
use crate::Tag;
1+
use crate::{ext::ObjectIdExt, Tag};
32

43
impl<'repo> Tag<'repo> {
54
/// Decode this tag and return the id of its target.

Diff for: git-revision/src/describe.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,19 @@ where
143143
}
144144

145145
pub(crate) mod function {
146-
use super::Error;
147-
use hash_hasher::HashBuildHasher;
148-
use std::cmp::Ordering;
149-
use std::collections::HashMap;
150146
use std::{
151147
borrow::Cow,
152-
collections::{hash_map, VecDeque},
148+
cmp::Ordering,
149+
collections::{hash_map, HashMap, VecDeque},
153150
iter::FromIterator,
154151
};
155152

156-
use crate::describe::{Flags, Options, MAX_CANDIDATES};
157153
use git_hash::oid;
158154
use git_object::{bstr::BStr, CommitRefIter};
155+
use hash_hasher::HashBuildHasher;
159156

160-
use super::Outcome;
157+
use super::{Error, Outcome};
158+
use crate::describe::{Flags, Options, MAX_CANDIDATES};
161159

162160
/// Given a `commit` id, traverse the commit graph and collect candidate names from the `name_by_oid` mapping to produce
163161
/// an `Outcome`, which converted [`into_format()`][Outcome::into_format()] will produce a typical `git describe` string.

Diff for: gitoxide-core/src/repository/commit.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
use std::path::PathBuf;
2+
13
use anyhow::{Context, Result};
24
use git_repository as git;
3-
use std::path::PathBuf;
45

56
pub fn describe(
67
repo: impl Into<PathBuf>,

Diff for: src/plumbing/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use std::{
99

1010
use anyhow::Result;
1111
use clap::Parser;
12-
1312
use gitoxide_core as core;
1413
use gitoxide_core::pack::verify;
1514

0 commit comments

Comments
 (0)