Skip to content

Commit

Permalink
just fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 21, 2023
1 parent 36f7b78 commit 0d258f4
Show file tree
Hide file tree
Showing 60 changed files with 187 additions and 181 deletions.
12 changes: 7 additions & 5 deletions gitoxide-core/src/repository/attributes/query.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::OutputFormat;
use gix::repository::IndexPersistedOrInMemory;

use crate::OutputFormat;

pub struct Options {
pub format: OutputFormat,
pub statistics: bool,
Expand All @@ -10,12 +11,13 @@ pub(crate) mod function {
use std::{io, path::Path};

use anyhow::{anyhow, bail};
use gix::bstr::BStr;
use gix::prelude::FindExt;
use gix::{bstr::BStr, prelude::FindExt};

use crate::repository::PathsOrPatterns;
use crate::{
repository::attributes::query::{attributes_cache, Options},
repository::{
attributes::query::{attributes_cache, Options},
PathsOrPatterns,
},
OutputFormat,
};

Expand Down
3 changes: 1 addition & 2 deletions gitoxide-core/src/repository/attributes/validate_baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ pub(crate) mod function {
};

use anyhow::{anyhow, bail};
use gix::bstr::BString;
use gix::{attrs::Assignment, odb::FindExt, Progress};
use gix::{attrs::Assignment, bstr::BString, odb::FindExt, Progress};

use crate::{
repository::attributes::{query::attributes_cache, validate_baseline::Options},
Expand Down
4 changes: 2 additions & 2 deletions gitoxide-core/src/repository/commit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{io::Write, process::Stdio};

use anyhow::{anyhow, bail, Context, Result};
use std::io::Write;
use std::process::Stdio;

/// Note that this is a quick implementation of commit signature verification that ignores a lot of what
/// git does and can do, while focussing on the gist of it.
Expand Down
6 changes: 2 additions & 4 deletions gitoxide-core/src/repository/exclude.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::io;

use anyhow::{anyhow, bail};
use gix::bstr::BStr;
use gix::prelude::FindExt;
use gix::{bstr::BStr, prelude::FindExt};

use crate::repository::PathsOrPatterns;
use crate::OutputFormat;
use crate::{repository::PathsOrPatterns, OutputFormat};

pub mod query {
use std::ffi::OsString;
Expand Down
7 changes: 5 additions & 2 deletions gitoxide-core/src/repository/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ pub const PROGRESS_RANGE: std::ops::RangeInclusive<u8> = 1..=3;

pub(crate) mod function {
use anyhow::bail;
use gix::remote::fetch::refs::update::TypeChange;
use gix::{prelude::ObjectIdExt, refspec::match_group::validate::Fix, remote::fetch::Status};
use gix::{
prelude::ObjectIdExt,
refspec::match_group::validate::Fix,
remote::fetch::{refs::update::TypeChange, Status},
};
use layout::{
backends::svg::SVGWriter,
core::{base::Orientation, geometry::Point, style::StyleAttr},
Expand Down
18 changes: 11 additions & 7 deletions gitoxide-core/src/repository/index/entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ pub enum Attributes {
}

pub(crate) mod function {
use gix::bstr::{BStr, BString};
use std::collections::BTreeSet;
use std::{
borrow::Cow,
collections::BTreeSet,
io::{BufWriter, Write},
};

use crate::OutputFormat;
use gix::odb::FindExt;
use gix::repository::IndexPersistedOrInMemory;
use gix::Repository;
use gix::{
bstr::{BStr, BString},
odb::FindExt,
repository::IndexPersistedOrInMemory,
Repository,
};

use crate::repository::index::entries::{Attributes, Options};
use crate::{
repository::index::entries::{Attributes, Options},
OutputFormat,
};

pub fn entries(
repo: gix::Repository,
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/repository/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use gix::bstr::BString;
use std::path::PathBuf;

use anyhow::{Context as AnyhowContext, Result};
use gix::bstr::BString;

pub fn init(directory: Option<PathBuf>) -> Result<gix::discover::repository::Path> {
gix::create::into(
Expand Down
3 changes: 1 addition & 2 deletions gix-actor/src/identity.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use bstr::ByteSlice;
use winnow::error::StrContext;
use winnow::prelude::*;
use winnow::{error::StrContext, prelude::*};

use crate::{signature::decode, Identity, IdentityRef};

Expand Down
4 changes: 1 addition & 3 deletions gix-actor/src/signature/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ pub(crate) mod function {
use btoi::btoi;
use gix_date::{time::Sign, OffsetInSeconds, SecondsSinceUnixEpoch, Time};
use winnow::{
combinator::alt,
combinator::separated_pair,
combinator::terminated,
combinator::{alt, separated_pair, terminated},
error::{AddContext, ParserError, StrContext},
prelude::*,
stream::AsChar,
Expand Down
3 changes: 1 addition & 2 deletions gix-actor/src/signature/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
mod _ref {
use bstr::ByteSlice;
use winnow::error::StrContext;
use winnow::prelude::*;
use winnow::{error::StrContext, prelude::*};

use crate::{signature::decode, IdentityRef, Signature, SignatureRef};

Expand Down
7 changes: 1 addition & 6 deletions gix-config/src/parse/nom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ use std::borrow::Cow;

use bstr::{BStr, ByteSlice};
use winnow::{
combinator::alt,
combinator::delimited,
combinator::fold_repeat,
combinator::opt,
combinator::preceded,
combinator::repeat,
combinator::{alt, delimited, fold_repeat, opt, preceded, repeat},
error::{ErrorKind, InputError as NomError, ParserError as _},
prelude::*,
stream::{Offset as _, Stream as _},
Expand Down
7 changes: 5 additions & 2 deletions gix-config/src/parse/nom/tests.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use super::*;

mod section_headers {
use winnow::prelude::*;

use super::section_header;
use crate::parse::tests::util::{fully_consumed, section_header as parsed_section_header};
use winnow::prelude::*;

#[test]
fn no_subsection() {
Expand Down Expand Up @@ -116,6 +117,7 @@ mod section_headers {

mod sub_section {
use std::borrow::Cow;

use winnow::prelude::*;

use super::sub_section;
Expand Down Expand Up @@ -859,9 +861,10 @@ mod key_value_pair {
}

mod comment {
use winnow::prelude::*;

use super::comment;
use crate::parse::tests::util::{comment as parsed_comment, fully_consumed};
use winnow::prelude::*;

#[test]
fn semicolon() {
Expand Down
6 changes: 1 addition & 5 deletions gix-object/src/commit/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ use std::borrow::Cow;

use smallvec::SmallVec;
use winnow::{
combinator::alt,
combinator::preceded,
combinator::repeat,
combinator::terminated,
combinator::{eof, opt, rest},
combinator::{alt, eof, opt, preceded, repeat, rest, terminated},
error::{AddContext, ParserError, StrContext},
prelude::*,
token::take_till1,
Expand Down
5 changes: 1 addition & 4 deletions gix-object/src/commit/message/body.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use std::ops::Deref;

use winnow::{
combinator::eof,
combinator::rest,
combinator::separated_pair,
combinator::terminated,
combinator::{eof, rest, separated_pair, terminated},
error::{ErrorKind, ParserError},
prelude::*,
token::take_until1,
Expand Down
7 changes: 5 additions & 2 deletions gix-object/src/commit/message/decode.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use winnow::{
combinator::alt, combinator::eof, combinator::preceded, combinator::rest, combinator::terminated,
error::ParserError, prelude::*, stream::Offset, stream::Stream, token::take_till1,
combinator::{alt, eof, preceded, rest, terminated},
error::ParserError,
prelude::*,
stream::{Offset, Stream},
token::take_till1,
};

use crate::bstr::{BStr, ByteSlice};
Expand Down
3 changes: 2 additions & 1 deletion gix-object/src/commit/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use bstr::{BStr, BString, ByteSlice};
use std::ops::Range;

use bstr::{BStr, BString, ByteSlice};

use crate::{Commit, CommitRef, TagRef};

mod decode;
Expand Down
16 changes: 9 additions & 7 deletions gix-object/src/commit/ref_iter.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
use std::borrow::Cow;
use std::ops::Range;
use std::{borrow::Cow, ops::Range};

use bstr::BStr;
use gix_hash::{oid, ObjectId};
use winnow::{
combinator::alt,
combinator::terminated,
combinator::{eof, opt},
combinator::{alt, eof, opt, terminated},
error::StrContext,
prelude::*,
token::take_till1,
};

use crate::commit::SignedData;
use crate::{bstr::ByteSlice, commit::decode, parse, parse::NL, CommitRefIter};
use crate::{
bstr::ByteSlice,
commit::{decode, SignedData},
parse,
parse::NL,
CommitRefIter,
};

#[derive(Copy, Clone)]
pub(crate) enum SignatureKind {
Expand Down
3 changes: 1 addition & 2 deletions gix-object/src/parse.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use bstr::{BStr, BString, ByteVec};
use winnow::{
combinator::repeat,
combinator::{preceded, terminated},
combinator::{preceded, repeat, terminated},
error::{AddContext, ParserError, StrContext},
prelude::*,
token::{take_till1, take_until0, take_while},
Expand Down
6 changes: 1 addition & 5 deletions gix-object/src/tag/decode.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use winnow::{
combinator::alt,
combinator::delimited,
combinator::rest,
combinator::{eof, opt},
combinator::{preceded, terminated},
combinator::{alt, delimited, eof, opt, preceded, rest, terminated},
error::{AddContext, ParserError, StrContext},
prelude::*,
stream::AsChar,
Expand Down
6 changes: 2 additions & 4 deletions gix-object/src/tag/ref_iter.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use bstr::BStr;
use gix_hash::{oid, ObjectId};
use winnow::{
combinator::terminated,
combinator::{eof, opt},
error::ParserError,
error::StrContext,
combinator::{eof, opt, terminated},
error::{ParserError, StrContext},
prelude::*,
stream::AsChar,
token::take_while,
Expand Down
6 changes: 2 additions & 4 deletions gix-object/src/tree/ref_iter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bstr::BStr;
use std::convert::TryFrom;

use bstr::BStr;
use winnow::error::ParserError;

use crate::{tree, tree::EntryRef, TreeRef, TreeRefIter};
Expand Down Expand Up @@ -117,9 +117,7 @@ mod decode {

use bstr::ByteSlice;
use winnow::{
combinator::eof,
combinator::repeat,
combinator::terminated,
combinator::{eof, repeat, terminated},
error::ParserError,
prelude::*,
stream::AsChar,
Expand Down
4 changes: 2 additions & 2 deletions gix-pathspec/src/defaults.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::Defaults;
use crate::{MagicSignature, SearchMode};
use std::ffi::OsString;

use crate::{Defaults, MagicSignature, SearchMode};

///
pub mod from_environment {
/// The error returned by [Defaults::from_environment()](super::Defaults::from_environment()).
Expand Down
4 changes: 2 additions & 2 deletions gix-pathspec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#![deny(missing_docs, rust_2018_idioms)]
#![forbid(unsafe_code)]

use bitflags::bitflags;
use bstr::BString;
use std::path::PathBuf;

use bitflags::bitflags;
use bstr::BString;
/// `gix-glob` types are available through [`attributes::glob`].
pub use gix_attributes as attributes;

Expand Down
6 changes: 4 additions & 2 deletions gix-pathspec/src/pattern.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::{normalize, MagicSignature, Pattern, SearchMode};
use bstr::{BStr, BString, ByteSlice, ByteVec};
use std::path::{Component, Path, PathBuf};

use bstr::{BStr, BString, ByteSlice, ByteVec};

use crate::{normalize, MagicSignature, Pattern, SearchMode};

/// Access
impl Pattern {
/// Returns `true` if this seems to be a pathspec that indicates that 'there is no pathspec'.
Expand Down
4 changes: 2 additions & 2 deletions gix-pathspec/src/search/init.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::search::Spec;
use crate::{MagicSignature, Pattern, Search};
use std::path::Path;

use crate::{search::Spec, MagicSignature, Pattern, Search};

/// Create a new specification to support matches from `pathspec`, [normalizing](Pattern::normalize()) it with `prefix` and `root`.
fn mapping_from_pattern(
mut pathspec: Pattern,
Expand Down
7 changes: 5 additions & 2 deletions gix-pathspec/src/search/matching.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
use crate::search::{Match, Spec};
use crate::{MagicSignature, Pattern, Search, SearchMode};
use bstr::{BStr, BString, ByteSlice};
use gix_glob::pattern::Case;

use crate::{
search::{Match, Spec},
MagicSignature, Pattern, Search, SearchMode,
};

impl Search {
/// Return the first [`Match`] of `relative_path`, or `None`.
/// `is_dir` is true if `relative_path` is a directory.
Expand Down
3 changes: 2 additions & 1 deletion gix-pathspec/src/search/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{Pattern, Search};
use bstr::{BStr, ByteSlice};

use crate::{Pattern, Search};

/// Describes a matching pattern within a search for ignored paths.
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
pub struct Match<'a> {
Expand Down
3 changes: 1 addition & 2 deletions gix-pathspec/tests/defaults.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use gix_pathspec::Defaults;
use gix_pathspec::{MagicSignature, SearchMode};
use gix_pathspec::{Defaults, MagicSignature, SearchMode};
use serial_test::serial;

#[test]
Expand Down
Loading

0 comments on commit 0d258f4

Please sign in to comment.