Skip to content

Commit

Permalink
make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Feb 25, 2023
1 parent 3827ac6 commit 8ef1cb2
Show file tree
Hide file tree
Showing 60 changed files with 157 additions and 141 deletions.
1 change: 0 additions & 1 deletion cargo-smart-release/src/changelog/section/from_history.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{collections::BTreeMap, ops::Sub};

use cargo_metadata::Package;

use gix::prelude::ObjectIdExt;
use time::OffsetDateTime;

Expand Down
3 changes: 2 additions & 1 deletion cargo-smart-release/src/changelog/write.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use gix::{bstr::ByteSlice, url::Scheme, Url};
use std::borrow::Cow;

use gix::{bstr::ByteSlice, url::Scheme, Url};

use crate::{
changelog,
changelog::{
Expand Down
1 change: 0 additions & 1 deletion cargo-smart-release/src/command/release/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::{convert::TryInto, process::Command};

use anyhow::{anyhow, bail};
use cargo_metadata::Package;

use gix::{bstr::ByteSlice, refs, refs::transaction::PreviousValue, Id};

use super::{tag_name, Options};
Expand Down
3 changes: 1 addition & 2 deletions cargo-smart-release/src/git/history.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use std::borrow::Cow;
use std::{
borrow::Cow,
collections::{BTreeMap, HashMap},
iter::FromIterator,
path::PathBuf,
};

use anyhow::bail;
use cargo_metadata::Package;

use gix::{
bstr::ByteSlice,
head,
Expand Down
1 change: 0 additions & 1 deletion cargo-smart-release/src/git/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::process::Command;

use anyhow::{anyhow, bail};
use cargo_metadata::{camino::Utf8Path, Package};

use gix::{
bstr::{BStr, ByteSlice},
object,
Expand Down
1 change: 0 additions & 1 deletion cargo-smart-release/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use cargo_metadata::{
camino::{Utf8Component, Utf8Path},
Dependency, DependencyKind, Metadata, Package, PackageId,
};

use gix::bstr::{BStr, ByteSlice};
use semver::{Version, VersionReq};
use time::OffsetDateTime;
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/hours/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{collections::BTreeSet, convert::Infallible, io, path::Path, sync::atomic::Ordering, time::Instant};

use anyhow::{anyhow, bail};

use gix::{
actor,
bstr::{BStr, ByteSlice},
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/index/checkout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::{
};

use anyhow::bail;

use gix::{odb::FindExt, worktree::index::checkout, Progress};

use crate::{
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/pack/create.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{ffi::OsStr, io, path::Path, str::FromStr, time::Instant};

use anyhow::anyhow;

use gix::{
hash,
hash::ObjectId,
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/pack/multi_index.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{io::BufWriter, path::PathBuf, sync::atomic::AtomicBool};

use anyhow::bail;

use gix::Progress;

use crate::OutputFormat;
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/pack/receive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ mod async_io {

use async_trait::async_trait;
use futures_io::AsyncBufRead;

use gix::{
bstr::{BString, ByteSlice},
odb::pack,
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/pack/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::{io, path::Path, str::FromStr, sync::atomic::AtomicBool};

use anyhow::{anyhow, Context as AnyhowContext, Result};
use bytesize::ByteSize;

use gix::{
object, odb,
odb::{pack, pack::index},
Expand Down
21 changes: 12 additions & 9 deletions gitoxide-core/src/query/engine/command.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use crate::query;
use crate::query::engine::update::FileMode;
use crate::query::Command;
use std::collections::HashMap;

use anyhow::Context;
use gix::bstr::ByteSlice;
use gix::prelude::ObjectIdExt;
use gix::Progress;
use gix::{bstr::ByteSlice, prelude::ObjectIdExt, Progress};
use rusqlite::{params, OptionalExtension};
use std::collections::HashMap;

use crate::{
query,
query::{engine::update::FileMode, Command},
};

impl query::Engine {
pub fn run(
Expand Down Expand Up @@ -110,10 +111,12 @@ impl query::Engine {
}

mod trace_path {
use crate::query::engine::update::FileMode;
use gix::prelude::ObjectIdExt;
use std::collections::HashMap;

use gix::prelude::ObjectIdExt;

use crate::query::engine::update::FileMode;

#[derive(Debug, Default, Copy, Clone)]
pub struct Diff {
pub lines_added: usize,
Expand Down
28 changes: 17 additions & 11 deletions gitoxide-core/src/query/engine/update.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
use crate::query::Options;
use std::{
convert::Infallible,
sync::atomic::{AtomicUsize, Ordering},
time::Instant,
};

use anyhow::{anyhow, bail};
use gix::bstr::{BStr, BString, ByteSlice};
use gix::features::progress;
use gix::object::tree::diff::rewrites::CopySource;
use gix::odb::FindExt;
use gix::parallel::{InOrderIter, SequenceId};
use gix::prelude::ObjectIdExt;
use gix::Progress;
use gix::{
bstr::{BStr, BString, ByteSlice},
features::progress,
object::tree::diff::rewrites::CopySource,
odb::FindExt,
parallel::{InOrderIter, SequenceId},
prelude::ObjectIdExt,
Progress,
};
use rusqlite::{params, Statement, Transaction};
use std::convert::Infallible;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Instant;

use crate::query::Options;

pub fn update(
repo: &gix::Repository,
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/repository/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub(crate) mod function {
use std::ffi::OsStr;

use anyhow::{bail, Context};

use gix::{bstr::BString, remote::fetch::Status, Progress};

use super::Options;
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/repository/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use anyhow::{bail, Result};

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

use crate::OutputFormat;
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/repository/exclude.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::io;

use anyhow::{bail, Context};

use gix::prelude::FindExt;

use crate::OutputFormat;
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/repository/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub const PROGRESS_RANGE: std::ops::RangeInclusive<u8> = 1..=3;

pub(crate) mod function {
use anyhow::bail;

use gix::{prelude::ObjectIdExt, refspec::match_group::validate::Fix, remote::fetch::Status};

use super::Options;
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/repository/remote.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#[cfg(any(feature = "blocking-client", feature = "async-client"))]
mod refs_impl {
use anyhow::bail;

use gix::{
protocol::handshake,
refspec::{match_group::validate::Fix, RefSpec},
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/repository/revision/explain.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use anyhow::bail;

use gix::{
bstr::{BStr, BString},
revision::plumbing::{
Expand Down
1 change: 0 additions & 1 deletion gitoxide-core/src/repository/revision/list.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::ffi::OsString;

use anyhow::{bail, Context};

use gix::prelude::ObjectIdExt;

use crate::OutputFormat;
Expand Down
4 changes: 1 addition & 3 deletions gitoxide-core/src/repository/tree.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
use std::{borrow::Cow, io};

use anyhow::bail;

use gix::Tree;

use crate::OutputFormat;

mod entries {
use std::collections::VecDeque;

use gix::bstr::{ByteSlice, ByteVec};
use gix::{
bstr::{BStr, BString},
bstr::{BStr, BString, ByteSlice, ByteVec},
objs::tree::EntryRef,
traverse::tree::visit::Action,
};
Expand Down
3 changes: 1 addition & 2 deletions gix-config/src/file/write.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use bstr::{BStr, BString, ByteSlice};

use crate::file::Section;
use crate::{parse::Event, File};
use crate::{file::Section, parse::Event, File};

impl File<'_> {
/// Serialize this type into a `BString` for convenience.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use gix_config::{
file::{includes, init},
path, File,
};

use tempfile::tempdir;

use crate::file::{cow_str, init::from_paths::escape_backslashes};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use gix_ref::{
transaction::{Change, PreviousValue, RefEdit},
FullName, Target,
};

use tempfile::tempdir;

use crate::file::{cow_str, init::from_paths::includes::conditional::git_init};
Expand Down
3 changes: 2 additions & 1 deletion gix-config/tests/file/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ fn complex_lossless_roundtrip() {
}

mod to_filter {
use crate::file::cow_str;
use bstr::ByteSlice;
use gix_config::file::Metadata;

use crate::file::cow_str;

#[test]
fn allows_only_selected_sections() -> crate::Result {
let mut config = gix_config::File::new(Metadata::api());
Expand Down
6 changes: 4 additions & 2 deletions gix-diff/src/tree/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,12 @@ fn peekable<I: Iterator>(iter: I) -> IteratorType<I> {

#[cfg(test)]
mod tests {
use super::*;
use gix_object::tree::EntryMode;
use std::cmp::Ordering;

use gix_object::tree::EntryMode;

use super::*;

#[test]
fn compare_select_samples() {
let null = gix_hash::ObjectId::null(gix_hash::Kind::Sha1);
Expand Down
3 changes: 1 addition & 2 deletions gix-diff/src/tree/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::collections::VecDeque;

use gix_hash::ObjectId;
use gix_object::bstr::BString;
use gix_object::TreeRefIter;
use gix_object::{bstr::BString, TreeRefIter};

/// The state required to visit [Changes] to be instantiated with `State::default()`.
#[derive(Default, Clone)]
Expand Down
3 changes: 1 addition & 2 deletions gix-diff/src/tree/visit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use gix_hash::ObjectId;
use gix_object::tree::EntryMode;
use gix_object::{bstr::BStr, tree};
use gix_object::{bstr::BStr, tree, tree::EntryMode};

/// Represents any possible change in order to turn one tree into another.
#[derive(Debug, Clone, PartialOrd, PartialEq, Ord, Eq, Hash)]
Expand Down
9 changes: 6 additions & 3 deletions gix-diff/tests/tree/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
mod changes {
mod to_obtain_tree {
use gix_diff::tree::recorder::Location;
use gix_diff::tree::{recorder, recorder::Change::*};
use std::collections::HashMap;

use gix_diff::tree::{
recorder,
recorder::{Change::*, Location},
};
use gix_hash::{oid, ObjectId};
use gix_object::{bstr::ByteSlice, tree::EntryMode, TreeRefIter};
use gix_odb::pack::Find;
use std::collections::HashMap;

use crate::hex_to_id;

Expand Down
2 changes: 1 addition & 1 deletion gix-features/src/progress.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Various `prodash` types along with various utilities for comfort.
use std::io;

pub use prodash;
pub use prodash::{
self,
messages::MessageLevel,
progress::{Discard, DoOrDiscard, Either, Id, Step, StepShared, Task, ThroughputOnDrop, Value, UNKNOWN},
unit, Progress, Unit,
Expand Down
3 changes: 1 addition & 2 deletions gix-index/tests/index/init.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use gix::prelude::FindExt;
use gix_index::{verify::extensions::no_find, State};
use gix_testtools::scripted_fixture_read_only_standalone;

use gix::prelude::FindExt;

#[test]
fn from_tree() -> crate::Result {
let fixtures = [
Expand Down
3 changes: 1 addition & 2 deletions gix-traverse/tests/tree/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use gix_object::bstr::BString;
use gix_odb::pack::FindExt;
use gix_traverse::tree;
use gix_traverse::tree::recorder::Location;
use gix_traverse::{tree, tree::recorder::Location};

use crate::hex_to_id;

Expand Down
1 change: 0 additions & 1 deletion gix/examples/init-repo-and-commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// adds initial commit with empty tree

use anyhow::Context;

use gix::objs::tree;

fn main() -> anyhow::Result<()> {
Expand Down
3 changes: 1 addition & 2 deletions gix/src/clone/fetch/util.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::io::Write;
use std::{borrow::Cow, convert::TryInto};
use std::{borrow::Cow, convert::TryInto, io::Write};

use gix_odb::Find;
use gix_ref::{
Expand Down
3 changes: 1 addition & 2 deletions gix/src/clone/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#![allow(clippy::result_large_err)]
use std::convert::TryInto;

use crate::bstr::BString;
use crate::config::tree::gitoxide;
use crate::{bstr::BString, config::tree::gitoxide};

type ConfigureRemoteFn =
Box<dyn FnMut(crate::Remote<'_>) -> Result<crate::Remote<'_>, Box<dyn std::error::Error + Send + Sync>>>;
Expand Down
Loading

0 comments on commit 8ef1cb2

Please sign in to comment.