Skip to content

Commit

Permalink
make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jul 11, 2022
1 parent 3d7fc18 commit 0700b09
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 24 deletions.
6 changes: 2 additions & 4 deletions git-config/src/file/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ use std::{

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

use crate::file::Size;
use crate::value::normalize_bstr;
use crate::{
file::Index,
file::{Index, Size},
lookup, parse,
parse::{section::Key, Event},
value::{normalize, normalize_bstring},
value::{normalize, normalize_bstr, normalize_bstring},
};

/// A opaque type that represents a mutable reference to a section.
Expand Down
3 changes: 2 additions & 1 deletion git-config/src/parse/nom/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,12 @@ mod section {
}

mod value_continuation {
use bstr::ByteSlice;

use crate::parse::{
section,
tests::util::{into_events, newline_event, value_done_event, value_not_done_event},
};
use bstr::ByteSlice;

pub fn value_impl<'a>(i: &'a [u8], events: &mut section::Events<'a>) -> nom::IResult<&'a [u8], ()> {
super::value_impl(i, &mut |e| events.push(e)).map(|t| (t.0, ()))
Expand Down
3 changes: 2 additions & 1 deletion git-config/tests/file/from_env/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
use std::{borrow::Cow, env, fs};

use crate::file::from_paths::escape_backslashes;
use git_config::{
file::{from_env, from_paths, from_paths::Options},
File,
};
use serial_test::serial;
use tempfile::tempdir;

use crate::file::from_paths::escape_backslashes;

pub struct Env<'a> {
altered_vars: Vec<&'a str>,
}
Expand Down
3 changes: 1 addition & 2 deletions git-config/tests/values/path.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
mod interpolate {
use git_config::path;
use std::{
borrow::Cow,
path::{Path, PathBuf},
};

use git_config::path::interpolate::Error;
use git_config::{path, path::interpolate::Error};

use crate::{file::cow_str, value::b};

Expand Down
3 changes: 2 additions & 1 deletion git-odb/src/alternate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
//! ```
//!
//! Based on the [canonical implementation](https://github.com/git/git/blob/master/sha1-file.c#L598:L609).
use git_path::realpath::MAX_SYMLINKS;
use std::{fs, io, path::PathBuf};

use git_path::realpath::MAX_SYMLINKS;

///
pub mod parse;

Expand Down
2 changes: 1 addition & 1 deletion git-path/src/realpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ pub enum Error {
pub const MAX_SYMLINKS: u8 = 32;

pub(crate) mod function {
use crate::realpath::MAX_SYMLINKS;
use std::path::{
Component::{CurDir, Normal, ParentDir, Prefix, RootDir},
Path, PathBuf,
};

use super::Error;
use crate::realpath::MAX_SYMLINKS;

/// Check each component of `path` and see if it is a symlink. If so, resolve it.
/// Do not fail for non-existing components, but assume these are as is.
Expand Down
4 changes: 2 additions & 2 deletions git-path/tests/convert/absolutize.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{borrow::Cow, path::Path};

use git_path::absolutize;
use std::borrow::Cow;
use std::path::Path;

fn p(input: &str) -> &Path {
Path::new(input)
Expand Down
3 changes: 2 additions & 1 deletion git-path/tests/realpath/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use git_path::{realpath::Error, realpath_opts};
use std::path::Path;

use git_path::{realpath::Error, realpath_opts};
use tempfile::tempdir;

#[test]
Expand Down
3 changes: 1 addition & 2 deletions git-repository/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,9 @@ pub mod state {
pub mod discover {
use std::path::Path;

use crate::bstr::BString;
pub use git_discover::*;

use crate::ThreadSafeRepository;
use crate::{bstr::BString, ThreadSafeRepository};

/// The error returned by [`crate::discover()`].
#[derive(Debug, thiserror::Error)]
Expand Down
3 changes: 1 addition & 2 deletions git-revision/tests/spec/parse/navigate/tilde_symbol.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use git_revision::spec;
use git_revision::spec::parse::delegate::Traversal;
use git_revision::{spec, spec::parse::delegate::Traversal};

use crate::spec::parse::{parse, try_parse};

Expand Down
18 changes: 12 additions & 6 deletions gitoxide-core/src/repository/revision/explain.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#![allow(unused_variables)]

use std::ffi::OsString;

use anyhow::bail;
use git::bstr::{BStr, BString, ByteSlice};
use git::revision::spec::parse::{delegate, Delegate};
use git::revision::{
spec,
spec::parse::delegate::{PeelTo, ReflogLookup, SiblingBranch, Traversal},
use git::{
bstr::{BStr, BString, ByteSlice},
revision::{
spec,
spec::parse::{
delegate,
delegate::{PeelTo, ReflogLookup, SiblingBranch, Traversal},
Delegate,
},
},
};
use git_repository as git;
use std::ffi::OsString;

pub fn explain(_repo: git::Repository, spec: OsString, mut out: impl std::io::Write) -> anyhow::Result<()> {
let mut explain = Explain::new(&mut out);
Expand Down
2 changes: 1 addition & 1 deletion src/porcelain/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ pub struct EstimateHours {
}

mod validator {
use git_repository as git;
use std::{ffi::OsStr, path::PathBuf};

use anyhow::Context;
use git_repository as git;

fn is_repo_inner(dir: &OsStr) -> anyhow::Result<()> {
let git_dir = PathBuf::from(dir).join(".git");
Expand Down

0 comments on commit 0700b09

Please sign in to comment.