Skip to content

Commit 51c7abc

Browse files
committed
j fmt
1 parent dfb3f18 commit 51c7abc

File tree

106 files changed

+317
-275
lines changed

Some content is hidden

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

106 files changed

+317
-275
lines changed

gitoxide-core/src/corpus/run.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use gix::progress::DynNestedProgress;
21
use std::{path::Path, sync::atomic::AtomicBool};
32

3+
use gix::progress::DynNestedProgress;
4+
45
use crate::{
56
corpus,
67
corpus::{Run, Task},

gitoxide-core/src/index/checkout.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use std::{
44
};
55

66
use anyhow::bail;
7-
use gix::objs::find::Error;
8-
use gix::{worktree::state::checkout, NestedProgress, Progress};
7+
use gix::{objs::find::Error, worktree::state::checkout, NestedProgress, Progress};
98

109
use crate::{
1110
index,

gitoxide-core/src/pack/receive.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ impl<W> protocol::fetch::DelegateBlocking for CloneDelegate<W> {
116116
mod blocking_io {
117117
use std::{io, io::BufRead, path::PathBuf};
118118

119-
use gix::config::tree::Key;
120119
use gix::{
121120
bstr::BString,
121+
config::tree::Key,
122122
protocol,
123123
protocol::{fetch::Response, handshake::Ref},
124124
NestedProgress,
@@ -194,18 +194,17 @@ mod blocking_io {
194194

195195
#[cfg(feature = "blocking-client")]
196196
pub use blocking_io::receive;
197-
use gix::protocol::ls_refs;
198-
use gix::NestedProgress;
197+
use gix::{protocol::ls_refs, NestedProgress};
199198

200199
#[cfg(feature = "async-client")]
201200
mod async_io {
202201
use std::{io, io::BufRead, path::PathBuf};
203202

204203
use async_trait::async_trait;
205204
use futures_io::AsyncBufRead;
206-
use gix::config::tree::Key;
207205
use gix::{
208206
bstr::{BString, ByteSlice},
207+
config::tree::Key,
209208
odb::pack,
210209
protocol,
211210
protocol::{fetch::Response, handshake::Ref},

gitoxide-core/src/query/engine/update.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
use std::cell::RefCell;
21
use std::{
2+
cell::RefCell,
33
convert::Infallible,
44
sync::atomic::{AtomicUsize, Ordering},
55
time::Instant,
66
};
77

88
use anyhow::{anyhow, bail};
9-
use gix::diff::blob::platform::prepare_diff::Operation;
10-
use gix::objs::find::Error;
119
use gix::{
1210
bstr::{BStr, BString, ByteSlice},
13-
diff::rewrites::CopySource,
11+
diff::{blob::platform::prepare_diff::Operation, rewrites::CopySource},
1412
features::progress,
13+
objs::find::Error,
1514
parallel::{InOrderIter, SequenceId},
1615
prelude::ObjectIdExt,
1716
Count, Progress,

gitoxide-core/src/repository/attributes/query.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ pub struct Options {
88
}
99

1010
pub(crate) mod function {
11-
use std::borrow::Cow;
12-
use std::{io, path::Path};
11+
use std::{borrow::Cow, io, path::Path};
1312

1413
use anyhow::{anyhow, bail};
1514
use gix::bstr::BStr;

gitoxide-core/src/repository/clone.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ pub struct Options {
1111
pub const PROGRESS_RANGE: std::ops::RangeInclusive<u8> = 1..=3;
1212

1313
pub(crate) mod function {
14-
use std::borrow::Cow;
15-
use std::ffi::OsStr;
14+
use std::{borrow::Cow, ffi::OsStr};
1615

1716
use anyhow::{bail, Context};
1817
use gix::{bstr::BString, remote::fetch::Status, NestedProgress};

gitoxide-core/src/repository/exclude.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::borrow::Cow;
2-
use std::io;
1+
use std::{borrow::Cow, io};
32

43
use anyhow::{anyhow, bail};
54
use gix::bstr::BStr;

gitoxide-core/src/repository/revision/resolve.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ pub(crate) mod function {
1919
use gix::revision::Spec;
2020

2121
use super::Options;
22-
use crate::repository::revision::resolve::TreeMode;
23-
use crate::{repository::revision, OutputFormat};
22+
use crate::{
23+
repository::{revision, revision::resolve::TreeMode},
24+
OutputFormat,
25+
};
2426

2527
pub fn resolve(
2628
mut repo: gix::Repository,

gitoxide-core/src/repository/status.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
use crate::OutputFormat;
21
use anyhow::{bail, Context};
3-
use gix::bstr::{BStr, BString};
4-
use gix::index::Entry;
5-
use gix::Progress;
6-
use gix_status::index_as_worktree::traits::FastEq;
7-
use gix_status::index_as_worktree::{Change, Conflict, EntryStatus};
2+
use gix::{
3+
bstr::{BStr, BString},
4+
index::Entry,
5+
Progress,
6+
};
7+
use gix_status::index_as_worktree::{traits::FastEq, Change, Conflict, EntryStatus};
8+
9+
use crate::OutputFormat;
810

911
pub enum Submodules {
1012
/// display all information about submodules, including ref changes, modifications and untracked files.

gitoxide-core/src/repository/submodule.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
use crate::OutputFormat;
21
use anyhow::bail;
3-
use gix::commit::describe::SelectRef;
4-
use gix::prelude::ObjectIdExt;
5-
use gix::{Repository, Submodule};
2+
use gix::{commit::describe::SelectRef, prelude::ObjectIdExt, Repository, Submodule};
3+
4+
use crate::OutputFormat;
65

76
pub fn list(repo: Repository, mut out: impl std::io::Write, format: OutputFormat) -> anyhow::Result<()> {
87
if format != OutputFormat::Human {

gix-command/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#![deny(rust_2018_idioms, missing_docs)]
33
#![forbid(unsafe_code)]
44

5+
use std::{ffi::OsString, path::PathBuf};
6+
57
use bstr::BString;
6-
use std::ffi::OsString;
7-
use std::path::PathBuf;
88

99
/// A structure to keep settings to use when invoking a command via [`spawn()`][Prepare::spawn()], after creating it with [`prepare()`].
1010
pub struct Prepare {

gix-config/tests/file/init/from_env.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use gix_config::{
44
file::{includes, init, init::from_env},
55
File,
66
};
7-
use gix_testtools::tempfile::tempdir;
8-
use gix_testtools::Env;
7+
use gix_testtools::{tempfile::tempdir, Env};
98
use serial_test::serial;
109

1110
use crate::file::init::from_paths::escape_backslashes;

gix-date/tests/time/baseline.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ use gix_date::{
44
time::{format, Format},
55
SecondsSinceUnixEpoch,
66
};
7-
use once_cell::sync::Lazy;
8-
97
use gix_testtools::Result;
8+
use once_cell::sync::Lazy;
109

1110
struct Sample {
1211
format_name: Option<String>,

gix-diff/src/blob/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
//! For using text diffs, please have a look at the [`imara-diff` documentation](https://docs.rs/imara-diff),
22
//! maintained by [Pascal Kuthe](https://github.com/pascalkuthe).
3-
pub use imara_diff::*;
4-
use std::collections::HashMap;
5-
use std::path::PathBuf;
3+
use std::{collections::HashMap, path::PathBuf};
64

75
use bstr::BString;
6+
pub use imara_diff::*;
87

98
///
109
pub mod pipeline;

gix-diff/src/blob/pipeline.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
use crate::blob::{Driver, Pipeline, ResourceKind};
1+
use std::{
2+
io::{Read, Write},
3+
path::{Path, PathBuf},
4+
process::{Command, Stdio},
5+
};
6+
27
use bstr::{BStr, ByteSlice};
3-
use gix_filter::driver::apply::{Delay, MaybeDelayed};
4-
use gix_filter::pipeline::convert::{ToGitOutcome, ToWorktreeOutcome};
8+
use gix_filter::{
9+
driver::apply::{Delay, MaybeDelayed},
10+
pipeline::convert::{ToGitOutcome, ToWorktreeOutcome},
11+
};
512
use gix_object::tree::EntryKind;
6-
use std::io::{Read, Write};
7-
use std::path::{Path, PathBuf};
8-
use std::process::{Command, Stdio};
13+
14+
use crate::blob::{Driver, Pipeline, ResourceKind};
915

1016
/// A way to access roots for different kinds of resources that are possibly located and accessible in a worktree.
1117
#[derive(Clone, Debug, Default)]

gix-diff/src/blob/platform.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
use std::{io::Write, process::Stdio};
2+
3+
use bstr::{BStr, BString, ByteSlice};
4+
15
use super::Algorithm;
26
use crate::blob::{pipeline, Pipeline, Platform, ResourceKind};
3-
use bstr::{BStr, BString, ByteSlice};
4-
use std::io::Write;
5-
use std::process::Stdio;
67

78
/// A key to uniquely identify either a location in the worktree, or in the object database.
89
#[derive(Clone)]
@@ -90,8 +91,10 @@ pub struct Resource<'a> {
9091

9192
///
9293
pub mod resource {
93-
use crate::blob::pipeline;
94-
use crate::blob::platform::{CacheKey, CacheValue, Resource};
94+
use crate::blob::{
95+
pipeline,
96+
platform::{CacheKey, CacheValue, Resource},
97+
};
9598

9699
impl<'a> Resource<'a> {
97100
pub(crate) fn new(key: &'a CacheKey, value: &'a CacheValue) -> Self {
@@ -148,9 +151,10 @@ pub mod resource {
148151

149152
///
150153
pub mod set_resource {
151-
use crate::blob::{pipeline, ResourceKind};
152154
use bstr::BString;
153155

156+
use crate::blob::{pipeline, ResourceKind};
157+
154158
/// The error returned by [Platform::set_resource](super::Platform::set_resource).
155159
#[derive(Debug, thiserror::Error)]
156160
#[allow(missing_docs)]
@@ -176,9 +180,10 @@ pub mod set_resource {
176180

177181
///
178182
pub mod prepare_diff {
179-
use crate::blob::platform::Resource;
180183
use bstr::BStr;
181184

185+
use crate::blob::platform::Resource;
186+
182187
/// The kind of operation that was performed during the [`diff`](super::Platform::prepare_diff()) operation.
183188
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
184189
pub enum Operation<'a> {
@@ -241,9 +246,10 @@ pub mod prepare_diff {
241246

242247
///
243248
pub mod prepare_diff_command {
244-
use bstr::BString;
245249
use std::ops::{Deref, DerefMut};
246250

251+
use bstr::BString;
252+
247253
/// The error returned by [Platform::prepare_diff_command()](super::Platform::prepare_diff_command()).
248254
#[derive(Debug, thiserror::Error)]
249255
#[allow(missing_docs)]

gix-diff/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
/// Re-export for use in public API.
1212
#[cfg(feature = "blob")]
1313
pub use gix_command as command;
14-
1514
/// Re-export for use in public API.
1615
#[cfg(feature = "blob")]
1716
pub use gix_object as object;

gix-diff/src/rewrites/tracker.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
//! - the set used for copy-detection is probably smaller by default.
77
use std::ops::Range;
88

9+
use bstr::BStr;
910
use gix_object::tree::{EntryKind, EntryMode};
1011

11-
use crate::blob::platform::prepare_diff::Operation;
12-
use crate::blob::{DiffLineStats, ResourceKind};
13-
use crate::rewrites::{CopySource, Outcome};
14-
use crate::{rewrites::Tracker, Rewrites};
15-
use bstr::BStr;
12+
use crate::{
13+
blob::{platform::prepare_diff::Operation, DiffLineStats, ResourceKind},
14+
rewrites::{CopySource, Outcome, Tracker},
15+
Rewrites,
16+
};
1617

1718
/// The kind of a change.
1819
#[derive(Debug, Copy, Clone, Ord, PartialOrd, PartialEq, Eq)]
@@ -75,10 +76,11 @@ impl<T: Change> Item<T> {
7576

7677
/// A module with types used in the user-callback in [Tracker::emit()](crate::rewrites::Tracker::emit()).
7778
pub mod visit {
78-
use crate::blob::DiffLineStats;
7979
use bstr::BStr;
8080
use gix_object::tree::EntryMode;
8181

82+
use crate::blob::DiffLineStats;
83+
8284
/// The source of a rewrite, rename or copy.
8385
#[derive(Debug, Clone, PartialEq, PartialOrd)]
8486
pub struct Source<'a> {
@@ -566,8 +568,7 @@ mod diff {
566568
#[cfg(test)]
567569
mod estimate_involved_items {
568570
use super::estimate_involved_items;
569-
use crate::rewrites::tracker::visit::SourceKind;
570-
use crate::rewrites::tracker::ChangeKind;
571+
use crate::rewrites::tracker::{visit::SourceKind, ChangeKind};
571572

572573
#[test]
573574
fn renames_count_unemitted_as_sources_and_destinations() {

gix-diff/src/tree/changes.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::{borrow::BorrowMut, collections::VecDeque};
22

3-
use gix_object::tree::EntryRef;
4-
use gix_object::FindExt;
3+
use gix_object::{tree::EntryRef, FindExt};
54

65
use crate::{
76
tree,

gix-diff/src/tree/visit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ pub trait Visit {
9494

9595
#[cfg(feature = "blob")]
9696
mod change_impls {
97-
use crate::rewrites::tracker::ChangeKind;
98-
use crate::tree::visit::Change;
9997
use gix_hash::oid;
10098
use gix_object::tree::EntryMode;
10199

100+
use crate::{rewrites::tracker::ChangeKind, tree::visit::Change};
101+
102102
impl crate::rewrites::tracker::Change for crate::tree::visit::Change {
103103
fn id(&self) -> &oid {
104104
match self {

gix-diff/tests/blob/pipeline.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
pub(crate) mod convert_to_diffable {
22

3-
use crate::util::ObjectDb;
4-
use gix_diff::blob::pipeline::Options;
5-
use gix_diff::blob::{pipeline, pipeline::WorktreeRoots, ResourceKind};
6-
use gix_filter::eol;
7-
use gix_filter::eol::AutoCrlf;
8-
use gix_object::bstr::ByteSlice;
9-
use gix_object::tree::EntryKind;
3+
use gix_diff::blob::{
4+
pipeline,
5+
pipeline::{Options, WorktreeRoots},
6+
ResourceKind,
7+
};
8+
use gix_filter::{eol, eol::AutoCrlf};
9+
use gix_object::{bstr::ByteSlice, tree::EntryKind};
1010
use gix_worktree::stack::state::attributes;
1111

12+
use crate::util::ObjectDb;
13+
1214
#[test]
1315
fn simple() -> crate::Result {
1416
for mode in [

gix-diff/tests/blob/platform.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
use crate::blob::pipeline::convert_to_diffable::default_options;
2-
use crate::hex_to_id;
3-
use crate::util::ObjectDb;
4-
use gix_diff::blob::platform::prepare_diff;
5-
use gix_diff::blob::platform::prepare_diff::Operation;
6-
use gix_diff::blob::{pipeline, platform, Algorithm, Platform, ResourceKind};
7-
use gix_object::bstr::{BString, ByteSlice};
8-
use gix_object::tree::EntryKind;
1+
use gix_diff::blob::{
2+
pipeline, platform,
3+
platform::{prepare_diff, prepare_diff::Operation},
4+
Algorithm, Platform, ResourceKind,
5+
};
6+
use gix_object::{
7+
bstr::{BString, ByteSlice},
8+
tree::EntryKind,
9+
};
910
use gix_worktree::stack::state::attributes;
1011

12+
use crate::{blob::pipeline::convert_to_diffable::default_options, hex_to_id, util::ObjectDb};
13+
1114
#[test]
1215
fn resources_of_worktree_and_odb_and_check_link() -> crate::Result {
1316
let mut platform = new_platform(

0 commit comments

Comments
 (0)