Skip to content

Commit

Permalink
make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 18, 2022
1 parent 5d0332f commit 429cccc
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 43 deletions.
3 changes: 2 additions & 1 deletion git-config/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ impl Source {

/// Environment information involving the `git` program itself.
mod git {
use bstr::{BStr, BString, ByteSlice};
use std::process::{Command, Stdio};

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

/// Returns the file that contains git configuration coming with the installation of the `git` file in the current `PATH`, or `None`
/// if no `git` executable was found or there were other errors during execution.
pub fn install_config_path() -> Option<&'static BStr> {
Expand Down
3 changes: 2 additions & 1 deletion git-index/src/access.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{entry, extension, Entry, PathStorage, State, Version};
use bstr::{BStr, ByteSlice};

use crate::{entry, extension, Entry, PathStorage, State, Version};

/// General information and entries
impl State {
/// Return the version used to store this state's information on disk.
Expand Down
6 changes: 4 additions & 2 deletions git-index/src/entry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ mod access {
}

mod _impls {
use crate::{Entry, State};
use bstr::BStr;
use std::cmp::Ordering;

use bstr::BStr;

use crate::{Entry, State};

impl Entry {
/// Compare one entry to another by their path, by comparing only their common path portion byte by byte, then resorting to
/// entry length and stage.
Expand Down
12 changes: 7 additions & 5 deletions git-index/src/init.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
use crate::{
entry::{Flags, Mode, Stat},
Entry, PathStorage, State, Version,
};
use std::collections::VecDeque;

use bstr::{BStr, BString, ByteSlice, ByteVec};
use git_object::{
tree::{self, EntryMode},
TreeRefIter,
};
use git_traverse::tree::{breadthfirst, visit::Action, Visit};
use std::collections::VecDeque;

use crate::{
entry::{Flags, Mode, Stat},
Entry, PathStorage, State, Version,
};

/// initialization
impl State {
Expand Down
3 changes: 1 addition & 2 deletions git-index/tests/index/init.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use git_index::verify::extensions::no_find;
use git_index::State;
use git_index::{verify::extensions::no_find, State};
use git_repository as git;
use git_repository::prelude::FindExt;
use git_testtools::scripted_fixture_repo_read_only;
Expand Down
5 changes: 2 additions & 3 deletions git-refspec/src/match_group/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::parse::Operation;
use crate::types::Mode;
use crate::{MatchGroup, RefSpecRef};
use std::collections::BTreeSet;

use crate::{parse::Operation, types::Mode, MatchGroup, RefSpecRef};

pub(crate) mod types;
pub use types::{Item, Mapping, Outcome, Source, SourceRef};

Expand Down
6 changes: 4 additions & 2 deletions git-refspec/src/match_group/types.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::RefSpecRef;
use std::borrow::Cow;

use bstr::{BStr, BString};
use git_hash::oid;
use std::borrow::Cow;

use crate::RefSpecRef;

/// A match group is able to match a list of ref specs in order while handling negation, conflicts and one to many mappings.
#[derive(Default, Debug, Clone)]
Expand Down
8 changes: 4 additions & 4 deletions git-refspec/src/match_group/util.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::match_group::Item;
use crate::RefSpecRef;
use std::{borrow::Cow, ops::Range};

use bstr::{BStr, BString, ByteSlice, ByteVec};
use git_hash::ObjectId;
use std::borrow::Cow;
use std::ops::Range;

use crate::{match_group::Item, RefSpecRef};

/// A type keeping enough information about a ref-spec to be able to efficiently match it against multiple matcher items.
pub struct Matcher<'a> {
Expand Down
10 changes: 7 additions & 3 deletions git-refspec/src/match_group/validate.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
use crate::match_group::{Outcome, Source};
use crate::RefSpecRef;
use bstr::BString;
use std::collections::BTreeMap;

use bstr::BString;

use crate::{
match_group::{Outcome, Source},
RefSpecRef,
};

/// All possible issues found while validating matched mappings.
#[derive(Debug, PartialEq, Eq)]
pub enum Issue {
Expand Down
3 changes: 2 additions & 1 deletion git-refspec/src/spec.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use bstr::BStr;

use crate::{
instruction::{Fetch, Push},
parse::Operation,
types::Mode,
Instruction, RefSpec, RefSpecRef,
};
use bstr::BStr;

/// Conversion. Use the [RefSpecRef][RefSpec::to_ref()] type for more usage options.
impl RefSpec {
Expand Down
7 changes: 5 additions & 2 deletions git-refspec/src/write.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use crate::instruction::{Fetch, Push};
use crate::{Instruction, RefSpecRef};
use bstr::BString;

use crate::{
instruction::{Fetch, Push},
Instruction, RefSpecRef,
};

impl RefSpecRef<'_> {
/// Reproduce ourselves in parseable form.
pub fn to_bstring(&self) -> BString {
Expand Down
7 changes: 5 additions & 2 deletions git-refspec/tests/match_group/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ mod single {
}

mod multiple {
use git_refspec::{
match_group::validate::Fix,
parse::{Error, Operation},
};

use crate::matching::baseline;
use git_refspec::match_group::validate::Fix;
use git_refspec::parse::{Error, Operation};

#[test]
fn fetch_only() {
Expand Down
16 changes: 9 additions & 7 deletions git-refspec/tests/matching/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ use git_testtools::once_cell::sync::Lazy;
static BASELINE: Lazy<baseline::Baseline> = Lazy::new(|| baseline::parse().unwrap());

pub mod baseline {
use crate::matching::BASELINE;
use std::{borrow::Borrow, collections::HashMap};

use bstr::{BString, ByteSlice, ByteVec};
use git_hash::ObjectId;
use git_refspec::match_group::validate::Fix;
use git_refspec::match_group::SourceRef;
use git_refspec::parse::Operation;
use git_refspec::MatchGroup;
use git_refspec::{
match_group::{validate::Fix, SourceRef},
parse::Operation,
MatchGroup,
};
use git_testtools::once_cell::sync::Lazy;
use std::borrow::Borrow;
use std::collections::HashMap;

use crate::matching::BASELINE;

#[derive(Debug)]
pub struct Ref {
Expand Down
3 changes: 1 addition & 2 deletions git-repository/src/remote/access.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use git_refspec::RefSpec;

use crate::bstr::BStr;
use crate::{remote, Remote};
use crate::{bstr::BStr, remote, Remote};

/// Access
impl Remote<'_> {
Expand Down
3 changes: 2 additions & 1 deletion git-sec/src/permission.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::Permission;
use std::fmt::{Debug, Display, Formatter};

use crate::Permission;

/// An error to use if an operation cannot proceed due to insufficient permissions.
///
/// It's up to the implementation to decide which permission is required for an operation, and which one
Expand Down
8 changes: 7 additions & 1 deletion gitoxide-core/src/hours.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ use std::{
use anyhow::{anyhow, bail};
use git_repository as git;
use git_repository::{
actor, bstr::BString, bstr::ByteSlice, interrupt, objs, prelude::*, progress, refs::file::ReferenceExt, Progress,
actor,
bstr::{BString, ByteSlice},
interrupt, objs,
prelude::*,
progress,
refs::file::ReferenceExt,
Progress,
};
use itertools::Itertools;
use rayon::prelude::*;
Expand Down
10 changes: 6 additions & 4 deletions gitoxide-core/src/repository/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
mod refs_impl {
use anyhow::bail;
use git_repository as git;
use git_repository::protocol::fetch;
use git_repository::refspec::match_group::validate::Fix;
use git_repository::refspec::RefSpec;
use git_repository::{
protocol::fetch,
refspec::{match_group::validate::Fix, RefSpec},
};

use crate::OutputFormat;

pub mod refs {
use crate::OutputFormat;
use git_repository::bstr::BString;

use crate::OutputFormat;

pub const PROGRESS_RANGE: std::ops::RangeInclusive<u8> = 1..=2;

pub enum Kind {
Expand Down

0 comments on commit 429cccc

Please sign in to comment.