Skip to content

Commit 251b6df

Browse files
committed
make fmt
1 parent 98da8ba commit 251b6df

File tree

32 files changed

+96
-68
lines changed

32 files changed

+96
-68
lines changed

Diff for: git-attributes/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#![forbid(unsafe_code)]
22
#![deny(rust_2018_idioms)]
33

4-
use bstr::{BStr, BString};
5-
use compact_str::CompactStr;
64
use std::path::PathBuf;
75

6+
use bstr::{BStr, BString};
7+
use compact_str::CompactStr;
88
pub use git_glob as glob;
99

1010
/// The state an attribute can be in, referencing the value.

Diff for: git-attributes/src/match_group.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
use crate::{Assignment, MatchGroup, PatternList, PatternMapping, State, StateRef};
1+
use std::{
2+
ffi::OsString,
3+
io::Read,
4+
path::{Path, PathBuf},
5+
};
6+
27
use bstr::{BStr, BString, ByteSlice, ByteVec};
3-
use std::ffi::OsString;
4-
use std::io::Read;
5-
use std::path::{Path, PathBuf};
8+
9+
use crate::{Assignment, MatchGroup, PatternList, PatternMapping, State, StateRef};
610

711
impl<'a> From<StateRef<'a>> for State {
812
fn from(s: StateRef<'a>) -> Self {

Diff for: git-attributes/tests/match_group/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
mod ignore {
2+
use std::io::Read;
3+
24
use bstr::{BStr, ByteSlice};
35
use git_attributes::{Ignore, Match, MatchGroup};
46
use git_glob::pattern::Case;
5-
use std::io::Read;
67

78
struct Expectations<'a> {
89
lines: bstr::Lines<'a>,

Diff for: git-credentials/src/helper.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,10 @@ mod tests {
181181
type Result = std::result::Result<(), Box<dyn std::error::Error>>;
182182

183183
mod encode_message {
184-
use super::*;
185184
use bstr::ByteSlice;
186185

186+
use super::*;
187+
187188
#[test]
188189
fn from_url() -> super::Result {
189190
let mut out = Vec::new();
@@ -193,9 +194,10 @@ mod tests {
193194
}
194195

195196
mod invalid {
196-
use super::*;
197197
use std::io;
198198

199+
use super::*;
200+
199201
#[test]
200202
fn contains_null() {
201203
assert_eq!(

Diff for: git-glob/src/pattern.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
use std::fmt;
2+
13
use bitflags::bitflags;
24
use bstr::{BStr, ByteSlice};
3-
use std::fmt;
45

56
use crate::{pattern, wildmatch, Pattern};
67

Diff for: git-glob/tests/pattern/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use git_glob::pattern::Mode;
2-
use git_glob::Pattern;
1+
use git_glob::{pattern::Mode, Pattern};
32

43
#[test]
54
fn display() {

Diff for: git-glob/tests/wildmatch/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use bstr::ByteSlice;
21
use std::{
32
fmt::{Debug, Display, Formatter},
43
panic::catch_unwind,
54
};
65

6+
use bstr::ByteSlice;
77
use git_glob::{pattern::Case, wildmatch, Pattern};
88

99
#[test]

Diff for: git-lock/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717

1818
use std::path::PathBuf;
1919

20-
use git_tempfile::handle::{Closed, Writable};
21-
2220
pub use git_tempfile as tempfile;
21+
use git_tempfile::handle::{Closed, Writable};
2322

2423
const DOT_LOCK_SUFFIX: &str = ".lock";
2524

Diff for: git-path/src/convert.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
use bstr::{BStr, BString};
21
use std::{
32
borrow::Cow,
43
ffi::OsStr,
54
path::{Path, PathBuf},
65
};
76

7+
use bstr::{BStr, BString};
8+
89
#[derive(Debug)]
910
/// The error type returned by [`into_bstr()`] and others may suffer from failed conversions from or to bytes.
1011
pub struct Utf8Error;

Diff for: git-path/src/spec.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
use crate::Spec;
2-
use bstr::{BStr, ByteSlice, ByteVec};
31
use std::ffi::OsStr;
42

3+
use bstr::{BStr, ByteSlice, ByteVec};
4+
5+
use crate::Spec;
6+
57
impl std::convert::TryFrom<&OsStr> for Spec {
68
type Error = crate::Utf8Error;
79

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

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use crate::bstr::BString;
2-
use crate::permission::EnvVarResourcePermission;
1+
use crate::{bstr::BString, permission::EnvVarResourcePermission};
32

43
#[derive(Debug, thiserror::Error)]
54
pub enum Error {
@@ -47,17 +46,15 @@ pub(crate) struct Cache {
4746
}
4847

4948
mod cache {
50-
use std::convert::TryFrom;
51-
use std::path::PathBuf;
49+
use std::{convert::TryFrom, path::PathBuf};
5250

5351
use git_config::{
5452
file::GitConfig,
5553
values::{Boolean, Integer},
5654
};
5755

5856
use super::{Cache, Error};
59-
use crate::bstr::ByteSlice;
60-
use crate::permission::EnvVarResourcePermission;
57+
use crate::{bstr::ByteSlice, permission::EnvVarResourcePermission};
6158

6259
impl Cache {
6360
pub fn new(

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ pub fn open(directory: impl Into<std::path::PathBuf>) -> Result<crate::Repositor
244244

245245
///
246246
pub mod permission {
247-
use git_sec::permission::Resource;
248-
use git_sec::Access;
247+
use git_sec::{permission::Resource, Access};
249248

250249
/// A permission to control access to the resource pointed to an environment variable.
251250
pub type EnvVarResourcePermission = Access<Resource, git_sec::Permission>;
@@ -299,9 +298,10 @@ pub mod rev_parse {
299298

300299
///
301300
pub mod init {
302-
use crate::ThreadSafeRepository;
303301
use std::path::Path;
304302

303+
use crate::ThreadSafeRepository;
304+
305305
/// The error returned by [`crate::init()`].
306306
#[derive(Debug, thiserror::Error)]
307307
#[allow(missing_docs)]
@@ -362,9 +362,10 @@ pub mod state {
362362

363363
///
364364
pub mod discover {
365-
use crate::{path, ThreadSafeRepository};
366365
use std::path::Path;
367366

367+
use crate::{path, ThreadSafeRepository};
368+
368369
/// The error returned by [`crate::discover()`].
369370
#[derive(Debug, thiserror::Error)]
370371
#[allow(missing_docs)]

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use std::path::PathBuf;
22

3-
use crate::Permissions;
43
use git_features::threading::OwnShared;
54
use git_sec::Trust;
65

6+
use crate::Permissions;
7+
78
/// A way to configure the usage of replacement objects, see `git replace`.
89
pub enum ReplacementObjects {
910
/// Allow replacement objects and configure the ref prefix the standard environment variable `GIT_REPLACE_REF_BASE`,

Diff for: git-repository/src/path/discover.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ impl Default for Options {
4141
}
4242

4343
pub(crate) mod function {
44-
use super::{Error, Options};
45-
use git_sec::Trust;
4644
use std::{
4745
borrow::Cow,
4846
path::{Component, Path},
4947
};
5048

49+
use git_sec::Trust;
50+
51+
use super::{Error, Options};
5152
use crate::path;
5253

5354
/// Find the location of the git repository directly in `directory` or in any of its parent directories and provide

Diff for: git-repository/src/path/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use std::path::PathBuf;
22

3-
use crate::{Kind, Path};
4-
53
#[cfg(all(feature = "unstable", feature = "git-path"))]
64
pub use git_path::*;
75

6+
use crate::{Kind, Path};
7+
88
///
99
pub mod create;
1010
///

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use git_sec::{permission::Resource, Access, Trust};
2+
13
use crate::permission::EnvVarResourcePermission;
2-
use git_sec::permission::Resource;
3-
use git_sec::{Access, Trust};
44

55
/// Permissions associated with various resources of a git repository
66
pub struct Permissions {

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use crate::Repository;
21
#[cfg(all(feature = "unstable", feature = "git-worktree"))]
32
pub use git_worktree::*;
43

4+
use crate::Repository;
5+
56
///
67
#[cfg(feature = "git-index")]
78
pub mod open_index {

Diff for: git-repository/tests/commit/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
mod describe {
2-
use crate::named_repo;
32
use git_repository::commit::describe::SelectRef::{AllRefs, AllTags, AnnotatedTags};
43

4+
use crate::named_repo;
5+
56
#[test]
67
fn tags_are_sorted_by_date_and_lexigraphically() {
78
let repo = named_repo("make_commit_describe_multiple_tags.sh").unwrap();

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::{named_repo, Result};
21
use git_repository as git;
32

3+
use crate::{named_repo, Result};
4+
45
#[test]
56
fn apply_mailbox() -> Result {
67
let repo = named_repo("make_am_repo.sh")?;

Diff for: git-sec/src/lib.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#![deny(unsafe_code, rust_2018_idioms, missing_docs)]
22
//! A shared trust model for `gitoxide` crates.
33
4-
use std::fmt::{Debug, Display, Formatter};
5-
use std::marker::PhantomData;
6-
use std::ops::Deref;
4+
use std::{
5+
fmt::{Debug, Display, Formatter},
6+
marker::PhantomData,
7+
ops::Deref,
8+
};
79

810
/// A way to specify how 'safe' we feel about a resource, typically about a git repository.
911
#[derive(Copy, Clone, Ord, PartialOrd, PartialEq, Eq, Debug, Hash)]
@@ -75,9 +77,10 @@ pub mod trust {
7577

7678
///
7779
pub mod permission {
78-
use crate::Access;
7980
use std::fmt::{Debug, Display};
8081

82+
use crate::Access;
83+
8184
/// A marker trait to signal tags for permissions.
8285
pub trait Tag: Debug + Clone {}
8386

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ pub mod capabilities;
2626
pub use capabilities::Capabilities;
2727

2828
mod non_io_types;
29-
pub use non_io_types::{Error, MessageKind, WriteMode};
30-
3129
pub use git_sec::identity::Account;
30+
pub use non_io_types::{Error, MessageKind, WriteMode};
3231

3332
///
3433
#[cfg(any(feature = "blocking-client", feature = "async-client"))]

Diff for: git-worktree/src/fs/cache/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
use super::Cache;
2-
use crate::fs;
3-
use crate::fs::PathOidMapping;
1+
use std::path::{Path, PathBuf};
2+
43
use bstr::{BStr, ByteSlice};
54
use git_hash::oid;
6-
use std::path::{Path, PathBuf};
5+
6+
use super::Cache;
7+
use crate::{fs, fs::PathOidMapping};
78

89
#[derive(Clone)]
910
pub enum State {

Diff for: git-worktree/src/fs/cache/platform.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
use crate::fs;
2-
use crate::fs::cache::{Platform, State};
3-
use crate::fs::PathOidMapping;
1+
use std::path::Path;
2+
43
use bstr::ByteSlice;
54
use git_hash::oid;
6-
use std::path::Path;
5+
6+
use crate::{
7+
fs,
8+
fs::{
9+
cache::{Platform, State},
10+
PathOidMapping,
11+
},
12+
};
713

814
impl<'a, 'paths> Platform<'a, 'paths> {
915
/// The full path to `relative` will be returned for use on the file system.

Diff for: git-worktree/src/fs/cache/state.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
use crate::fs::cache::State;
2-
use crate::fs::PathOidMapping;
1+
use std::path::Path;
2+
33
use bstr::{BStr, BString, ByteSlice};
44
use git_glob::pattern::Case;
55
use git_hash::oid;
6-
use std::path::Path;
6+
7+
use crate::fs::{cache::State, PathOidMapping};
78

89
type AttributeMatchGroup = git_attributes::MatchGroup<git_attributes::Attributes>;
910
type IgnoreMatchGroup = git_attributes::MatchGroup<git_attributes::Ignore>;

Diff for: git-worktree/src/fs/capabilities.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::fs::Capabilities;
21
use std::path::Path;
32

3+
use crate::fs::Capabilities;
4+
45
#[cfg(windows)]
56
impl Default for Capabilities {
67
fn default() -> Self {

Diff for: git-worktree/src/fs/mod.rs

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

3+
use bstr::BStr;
4+
45
/// Common knowledge about the worktree that is needed across most interactions with the work tree
56
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
67
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]

Diff for: git-worktree/src/fs/stack.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::fs::Stack;
21
use std::path::{Path, PathBuf};
32

3+
use crate::fs::Stack;
4+
45
impl Stack {
56
pub fn root(&self) -> &Path {
67
&self.root

Diff for: git-worktree/tests/worktree/fs/cache.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,12 @@ mod create_directory {
117117

118118
#[allow(unused)]
119119
mod ignore_and_attributes {
120-
use bstr::{BStr, ByteSlice};
121120
use std::path::Path;
122121

122+
use bstr::{BStr, ByteSlice};
123123
use git_glob::pattern::Case;
124124
use git_index::entry::Mode;
125-
use git_odb::pack::bundle::write::Options;
126-
use git_odb::FindExt;
125+
use git_odb::{pack::bundle::write::Options, FindExt};
127126
use git_testtools::hex_to_id;
128127
use git_worktree::fs;
129128
use tempfile::{tempdir, TempDir};

0 commit comments

Comments
 (0)