Skip to content

Commit

Permalink
fmt (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Nov 28, 2021
1 parent b5a749e commit fbeddeb
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 23 deletions.
6 changes: 4 additions & 2 deletions experiments/odb-redesign/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ mod odb {
};

pub mod policy {
use std::path::Path;
use std::{io, path::PathBuf};
use std::{
io,
path::{Path, PathBuf},
};

use git_hash::oid;

Expand Down
2 changes: 1 addition & 1 deletion git-pack/src/cache/delta/traverse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use std::{
sync::atomic::{AtomicBool, Ordering},
};

use git_features::threading::{lock, Mutable, OwnShared};
use git_features::{
parallel,
parallel::in_parallel_if,
progress::{self, Progress},
threading::{lock, Mutable, OwnShared},
};

use crate::{
Expand Down
7 changes: 5 additions & 2 deletions git-pack/src/index/traverse/reduce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ use std::{
time::Instant,
};

use git_features::threading::{lock, Mutable, OwnShared};
use git_features::{parallel, progress::Progress};
use git_features::{
parallel,
progress::Progress,
threading::{lock, Mutable, OwnShared},
};

use crate::{data, index::traverse};

Expand Down
2 changes: 1 addition & 1 deletion git-pack/src/index/traverse/with_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ mod options {
}
}
}
use git_features::threading::{lock, Mutable, OwnShared};
use std::sync::atomic::Ordering;

use git_features::threading::{lock, Mutable, OwnShared};
pub use options::Options;

/// Verify and validate the content of the index file
Expand Down
3 changes: 2 additions & 1 deletion git-ref/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ pub mod store {
#[path = "general/handle/mod.rs"]
mod handle;

use crate::file;
pub use handle::find;

use crate::file;
}

/// The git reference store.
Expand Down
9 changes: 5 additions & 4 deletions git-ref/src/store/file/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use git_features::threading::{MutableOnDemand, OwnShared};
use std::path::PathBuf;

use git_features::threading::{MutableOnDemand, OwnShared};

/// A store for reference which uses plain files.
///
/// Each ref is represented as a single file on disk in a folder structure that follows the relative path
Expand All @@ -22,9 +23,10 @@ pub struct Store {
}

mod access {
use crate::file;
use std::path::Path;

use crate::file;

impl file::Store {
/// Return the root at which all references are loaded.
pub fn base(&self) -> &Path {
Expand Down Expand Up @@ -84,5 +86,4 @@ pub mod packed;
mod raw_ext;
pub use raw_ext::ReferenceExt;

use crate::store::WriteReflog;
use crate::Namespace;
use crate::{store::WriteReflog, Namespace};
6 changes: 4 additions & 2 deletions git-ref/src/store/file/packed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ pub mod transaction {
}

pub(crate) mod modifiable {
use crate::file;
use git_features::threading::{get_ref_upgradeable, upgrade_ref_to_mut, OwnShared};
use std::time::SystemTime;

use git_features::threading::{get_ref_upgradeable, upgrade_ref_to_mut, OwnShared};

use crate::file;

#[derive(Debug, Default)]
pub(crate) struct State {
buffer: Option<OwnShared<crate::packed::Buffer>>,
Expand Down
15 changes: 10 additions & 5 deletions git-ref/src/store/general/handle/find.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use crate::{store, PartialNameRef, Reference};
use std::convert::TryInto;

use crate::{store, PartialNameRef, Reference};

mod error {
use quick_error::quick_error;
use std::convert::Infallible;

use quick_error::quick_error;

quick_error! {
/// The error returned by [crate::Store::find()].
#[derive(Debug)]
Expand All @@ -30,9 +32,10 @@ mod error {
}
}

use crate::store::handle;
pub use error::Error;

use crate::store::handle;

impl store::Handle {
/// TODO: actually implement this with handling of the packed buffer.
pub fn try_find<'a, Name, E>(&self, partial: Name) -> Result<Option<Reference>, Error>
Expand Down Expand Up @@ -72,10 +75,12 @@ mod existing {
}
}

use crate::{store, PartialNameRef, Reference};
pub use error::Error;
use std::convert::TryInto;

pub use error::Error;

use crate::{store, PartialNameRef, Reference};

impl store::Handle {
/// Similar to [`file::Store::find()`] but a non-existing ref is treated as error.
pub fn find<'a, Name, E>(&self, _partial: Name) -> Result<Reference, Error>
Expand Down
7 changes: 4 additions & 3 deletions git-ref/src/store/general/init.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{convert::TryFrom, path::PathBuf};

use crate::store::WriteReflog;
use std::convert::TryFrom;
use std::path::PathBuf;

mod error {
use quick_error::quick_error;
Expand All @@ -19,9 +19,10 @@ mod error {
}
}

use crate::file;
pub use error::Error;

use crate::file;

impl crate::Store {
/// Create a new store at the given location, typically the `.git/` directory.
pub fn at(git_dir: impl Into<PathBuf>, reflog_mode: WriteReflog) -> Result<Self, Error> {
Expand Down
3 changes: 2 additions & 1 deletion git-ref/src/store/packed/transaction.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use git_features::threading::OwnShared;
use std::io::Write;

use git_features::threading::OwnShared;

use crate::{
store_impl::{file::transaction::FindObjectFn, packed, packed::Edit},
transaction::{Change, RefEdit},
Expand Down
1 change: 0 additions & 1 deletion src/plumbing/pretty/options.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{ffi::OsString, path::PathBuf};

use clap::AppSettings;

use gitoxide_core as core;

#[derive(Debug, clap::Parser)]
Expand Down

0 comments on commit fbeddeb

Please sign in to comment.