Skip to content

Commit c3c6504

Browse files
committed
j fmt
1 parent 6f009d7 commit c3c6504

File tree

265 files changed

+1254
-874
lines changed

Some content is hidden

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

265 files changed

+1254
-874
lines changed

gitoxide-core/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@
3030
#![deny(rust_2018_idioms)]
3131
#![forbid(unsafe_code)]
3232

33-
use anyhow::bail;
3433
use std::str::FromStr;
3534

35+
use anyhow::bail;
36+
3637
#[derive(Debug, Eq, PartialEq, Hash, Clone, Copy)]
3738
pub enum OutputFormat {
3839
Human,

gitoxide-core/src/organize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::borrow::Cow;
21
use std::{
2+
borrow::Cow,
33
ffi::OsStr,
44
path::{Path, PathBuf},
55
};

gitoxide-core/src/pack/receive.rs

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use crate::net;
2-
use crate::pack::receive::protocol::fetch::negotiate;
3-
use crate::OutputFormat;
4-
use gix::config::tree::Key;
5-
use gix::protocol::maybe_async;
6-
use gix::remote::fetch::Error;
7-
use gix::DynNestedProgress;
1+
use std::{
2+
io,
3+
path::PathBuf,
4+
sync::{atomic::AtomicBool, Arc},
5+
};
6+
7+
use gix::{config::tree::Key, protocol::maybe_async, remote::fetch::Error, DynNestedProgress};
88
pub use gix::{
99
hash::ObjectId,
1010
objs::bstr::{BString, ByteSlice},
@@ -18,11 +18,8 @@ pub use gix::{
1818
},
1919
NestedProgress, Progress,
2020
};
21-
use std::{
22-
io,
23-
path::PathBuf,
24-
sync::{atomic::AtomicBool, Arc},
25-
};
21+
22+
use crate::{net, pack::receive::protocol::fetch::negotiate, OutputFormat};
2623

2724
pub const PROGRESS_RANGE: std::ops::RangeInclusive<u8> = 1..=3;
2825
pub struct Context<W> {

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ pub struct Options {
88
}
99

1010
pub(crate) mod function {
11+
use std::{borrow::Cow, io, path::Path};
12+
1113
use anyhow::bail;
1214
use gix::bstr::BStr;
13-
use std::borrow::Cow;
14-
use std::{io, path::Path};
1515

1616
use crate::{
1717
is_dir_to_mode,

gitoxide-core/src/repository/blame.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use gix::bstr::ByteSlice;
2-
use gix::config::tree;
31
use std::ffi::OsStr;
42

3+
use gix::{bstr::ByteSlice, config::tree};
4+
55
pub fn blame_file(
66
mut repo: gix::Repository,
77
file: &OsStr,

gitoxide-core/src/repository/cat.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
use crate::repository::revision::resolve::{BlobFormat, TreeMode};
21
use anyhow::{anyhow, Context};
3-
use gix::diff::blob::ResourceKind;
4-
use gix::filter::plumbing::driver::apply::Delay;
5-
use gix::revision::Spec;
2+
use gix::{diff::blob::ResourceKind, filter::plumbing::driver::apply::Delay, revision::Spec};
3+
4+
use crate::repository::revision::resolve::{BlobFormat, TreeMode};
65

76
pub fn display_object(
87
repo: &gix::Repository,

gitoxide-core/src/repository/clean.rs

+16-10
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,23 @@ pub struct Options {
2020
pub find_untracked_repositories: FindRepository,
2121
}
2222
pub(crate) mod function {
23-
use crate::repository::clean::{FindRepository, Options};
24-
use crate::OutputFormat;
23+
use std::{borrow::Cow, path::Path};
24+
2525
use anyhow::bail;
26-
use gix::bstr::BString;
27-
use gix::bstr::ByteSlice;
28-
use gix::dir::entry::{Kind, Status};
29-
use gix::dir::walk::EmissionMode::CollapseDirectory;
30-
use gix::dir::walk::ForDeletionMode::*;
31-
use gix::dir::{walk, EntryRef};
32-
use std::borrow::Cow;
33-
use std::path::Path;
26+
use gix::{
27+
bstr::{BString, ByteSlice},
28+
dir::{
29+
entry::{Kind, Status},
30+
walk,
31+
walk::{EmissionMode::CollapseDirectory, ForDeletionMode::*},
32+
EntryRef,
33+
},
34+
};
35+
36+
use crate::{
37+
repository::clean::{FindRepository, Options},
38+
OutputFormat,
39+
};
3440

3541
pub fn clean(
3642
repo: gix::Repository,

gitoxide-core/src/repository/diff.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
use anyhow::Context;
2-
use gix::bstr::{BString, ByteSlice};
3-
use gix::diff::blob::intern::TokenSource;
4-
use gix::diff::blob::unified_diff::{ContextSize, NewlineSeparator};
5-
use gix::diff::blob::UnifiedDiff;
6-
use gix::objs::tree::EntryMode;
7-
use gix::odb::store::RefreshMode;
8-
use gix::prelude::ObjectIdExt;
9-
use gix::ObjectId;
2+
use gix::{
3+
bstr::{BString, ByteSlice},
4+
diff::blob::{
5+
intern::TokenSource,
6+
unified_diff::{ContextSize, NewlineSeparator},
7+
UnifiedDiff,
8+
},
9+
objs::tree::EntryMode,
10+
odb::store::RefreshMode,
11+
prelude::ObjectIdExt,
12+
ObjectId,
13+
};
1014

1115
pub fn tree(
1216
mut repo: gix::Repository,

gitoxide-core/src/repository/dirty.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::OutputFormat;
21
use anyhow::bail;
32

3+
use crate::OutputFormat;
4+
45
pub enum Mode {
56
IsClean,
67
IsDirty,

gitoxide-core/src/repository/index/entries.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ pub(crate) mod function {
2323
io::{BufWriter, Write},
2424
};
2525

26-
use gix::index::entry::Stage;
2726
use gix::{
2827
bstr::{BStr, BString},
28+
index::entry::Stage,
2929
worktree::IndexPersistedOrInMemory,
3030
Repository,
3131
};

gitoxide-core/src/repository/mailmap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use anyhow::bail;
2-
use gix::bstr::{BString, ByteSlice};
31
use std::io;
42

3+
use anyhow::bail;
4+
use gix::bstr::{BString, ByteSlice};
55
#[cfg(feature = "serde")]
66
use gix::mailmap::Entry;
77

gitoxide-core/src/repository/merge/commit.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
use crate::OutputFormat;
21
use anyhow::{anyhow, bail, Context};
3-
use gix::bstr::BString;
4-
use gix::bstr::ByteSlice;
5-
use gix::merge::tree::TreatAsUnresolved;
6-
use gix::prelude::Write;
2+
use gix::{
3+
bstr::{BString, ByteSlice},
4+
merge::tree::TreatAsUnresolved,
5+
prelude::Write,
6+
};
77

88
use super::tree::Options;
9+
use crate::OutputFormat;
910

1011
#[allow(clippy::too_many_arguments)]
1112
pub fn commit(

gitoxide-core/src/repository/merge/file.rs

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
use crate::OutputFormat;
2-
use anyhow::{anyhow, bail, Context};
3-
use gix::bstr::BString;
4-
use gix::bstr::ByteSlice;
5-
use gix::merge::blob::builtin_driver::binary;
6-
use gix::merge::blob::builtin_driver::text::Conflict;
7-
use gix::merge::blob::pipeline::WorktreeRoots;
8-
use gix::merge::blob::{Resolution, ResourceKind};
9-
use gix::object::tree::EntryKind;
10-
use gix::Id;
111
use std::path::Path;
122

3+
use anyhow::{anyhow, bail, Context};
4+
use gix::{
5+
bstr::{BString, ByteSlice},
6+
merge::blob::{
7+
builtin_driver::{binary, text::Conflict},
8+
pipeline::WorktreeRoots,
9+
Resolution, ResourceKind,
10+
},
11+
object::tree::EntryKind,
12+
Id,
13+
};
14+
15+
use crate::OutputFormat;
16+
1317
pub fn file(
1418
repo: gix::Repository,
1519
out: &mut dyn std::io::Write,

gitoxide-core/src/repository/merge/tree.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ pub struct Options {
1010

1111
pub(super) mod function {
1212

13-
use crate::OutputFormat;
1413
use anyhow::{anyhow, bail, Context};
15-
use gix::bstr::BString;
16-
use gix::bstr::ByteSlice;
17-
use gix::merge::tree::TreatAsUnresolved;
18-
use gix::prelude::Write;
14+
use gix::{
15+
bstr::{BString, ByteSlice},
16+
merge::tree::TreatAsUnresolved,
17+
prelude::Write,
18+
};
1919

2020
use super::Options;
21+
use crate::OutputFormat;
2122

2223
#[allow(clippy::too_many_arguments)]
2324
pub fn tree(

gitoxide-core/src/repository/merge_base.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::OutputFormat;
21
use anyhow::bail;
32

3+
use crate::OutputFormat;
4+
45
pub fn merge_base(
56
mut repo: gix::Repository,
67
first: String,

gitoxide-core/src/repository/odb.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::io;
2-
use std::sync::atomic::Ordering;
1+
use std::{io, sync::atomic::Ordering};
32

43
use anyhow::bail;
54

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ pub(crate) mod function {
2828
use gix::revision::Spec;
2929

3030
use super::Options;
31-
use crate::repository::cat::display_object;
32-
use crate::repository::revision::resolve::BlobFormat;
33-
use crate::{repository::revision, OutputFormat};
31+
use crate::{
32+
repository::{cat::display_object, revision, revision::resolve::BlobFormat},
33+
OutputFormat,
34+
};
3435

3536
pub fn resolve(
3637
mut repo: gix::Repository,

gitoxide-core/src/repository/status.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
use std::path::Path;
2+
13
use anyhow::bail;
2-
use gix::bstr::{BStr, BString, ByteSlice};
3-
use gix::status::{self, index_worktree};
4+
use gix::{
5+
bstr::{BStr, BString, ByteSlice},
6+
status::{self, index_worktree},
7+
};
48
use gix_status::index_as_worktree::{Change, Conflict, EntryStatus};
5-
use std::path::Path;
69

710
use crate::OutputFormat;
811

gitoxide-core/src/repository/tree.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1+
use std::{borrow::Cow, io, io::BufWriter};
2+
13
use anyhow::bail;
24
use gix::Tree;
3-
use std::io::BufWriter;
4-
use std::{borrow::Cow, io};
55

66
use crate::OutputFormat;
77

88
mod entries {
9+
use std::collections::VecDeque;
10+
911
use gix::{
1012
bstr::{BStr, BString, ByteSlice, ByteVec},
1113
objs::tree::EntryRef,
1214
traverse::tree::visit::Action,
1315
};
14-
use std::collections::VecDeque;
1516

1617
use crate::repository::tree::format_entry;
1718

gitoxide-core/src/repository/worktree.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::OutputFormat;
21
use anyhow::bail;
32

3+
use crate::OutputFormat;
4+
45
pub fn list(repo: gix::Repository, out: &mut dyn std::io::Write, format: OutputFormat) -> anyhow::Result<()> {
56
if format != OutputFormat::Human {
67
bail!("JSON output isn't implemented yet");

gix-actor/src/signature/decode.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
pub(crate) mod function {
2-
use crate::{IdentityRef, SignatureRef};
32
use bstr::ByteSlice;
4-
use winnow::error::ErrMode;
5-
use winnow::stream::Stream;
63
use winnow::{
74
combinator::{opt, separated_pair},
8-
error::{AddContext, ParserError, StrContext},
5+
error::{AddContext, ErrMode, ParserError, StrContext},
96
prelude::*,
10-
stream::AsChar,
7+
stream::{AsChar, Stream},
118
token::take_while,
129
};
1310

11+
use crate::{IdentityRef, SignatureRef};
12+
1413
/// Parse a signature from the bytes input `i` using `nom`.
1514
pub fn decode<'a, E: ParserError<&'a [u8]> + AddContext<&'a [u8], StrContext>>(
1615
i: &mut &'a [u8],
@@ -85,10 +84,11 @@ pub use function::identity;
8584
#[cfg(test)]
8685
mod tests {
8786
mod parse_signature {
88-
use crate::{signature, SignatureRef};
8987
use gix_testtools::to_bstr_err;
9088
use winnow::prelude::*;
9189

90+
use crate::{signature, SignatureRef};
91+
9292
fn decode<'i>(
9393
i: &mut &'i [u8],
9494
) -> ModalResult<SignatureRef<'i>, winnow::error::TreeError<&'i [u8], winnow::error::StrContext>> {

gix-actor/src/signature/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ mod _ref {
6565
}
6666

6767
mod convert {
68-
use crate::{Signature, SignatureRef};
6968
use gix_date::parse::TimeBuf;
7069

70+
use crate::{Signature, SignatureRef};
71+
7172
impl Signature {
7273
/// Borrow this instance as immutable, serializing the `time` field into `buf`.
7374
pub fn to_ref<'a>(&'a self, time_buf: &'a mut TimeBuf) -> SignatureRef<'a> {
@@ -91,10 +92,11 @@ mod convert {
9192
}
9293

9394
pub(crate) mod write {
94-
use crate::{Signature, SignatureRef};
9595
use bstr::{BStr, ByteSlice};
9696
use gix_date::parse::TimeBuf;
9797

98+
use crate::{Signature, SignatureRef};
99+
98100
/// The Error produced by [`Signature::write_to()`].
99101
#[derive(Debug, thiserror::Error)]
100102
#[allow(missing_docs)]

gix-attributes/src/name.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use crate::{Name, NameRef};
21
use bstr::{BStr, BString, ByteSlice};
32
use kstring::KStringRef;
43

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

0 commit comments

Comments
 (0)