Skip to content

Commit

Permalink
Rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Dec 11, 2023
1 parent 9078ca7 commit 6314fe0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
11 changes: 4 additions & 7 deletions src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,10 @@ pub fn read_lock_files(
{
// This will most likely be an extremely short list, so we just do a
// linear search
let Some((ind, registry)) = registries
.iter()
.enumerate()
.find(|(_, reg)| {
source.ends_with(tame_index::CRATES_IO_INDEX) && reg.is_crates_io() || source.ends_with(reg.index.as_str())
})
else {
let Some((ind, registry)) = registries.iter().enumerate().find(|(_, reg)| {
source.ends_with(tame_index::CRATES_IO_INDEX) && reg.is_crates_io()
|| source.ends_with(reg.index.as_str())
}) else {
warn!(
"skipping '{}:{}': unknown registry index '{reg_src}' encountered",
pkg.name, pkg.version
Expand Down
9 changes: 4 additions & 5 deletions src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ impl Submodule {
}

fn read_submodule_config(config: &gix::config::File<'_>) -> Vec<Submodule> {
let Some(iter) = config.sections_by_name("submodule") else { return Vec::new(); };
let Some(iter) = config.sections_by_name("submodule") else {
return Vec::new();
};

iter.filter_map(|sec| {
// Each submodule _should_ be a subsection with a name, that
Expand Down Expand Up @@ -393,10 +395,7 @@ pub(crate) fn prepare_submodules(src: PathBuf, target: PathBuf, rev: gix::Object
// A submodule which is listed in .gitmodules but not actually
// checked out will not have a head id, so we should ignore it.
let Some(head) = subm.head_id else {
tracing::debug!(
"skipping submodule '{}' without HEAD",
subm.name
);
tracing::debug!("skipping submodule '{}' without HEAD", subm.name);
return Ok(());
};

Expand Down
4 changes: 3 additions & 1 deletion src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,9 @@ pub async fn crates(ctx: &crate::Ctx) -> anyhow::Result<Summary> {
// As each remote I/O op completes, pass it off to the thread pool to do
// the more CPU intensive work of decompression, etc
while let Some(res) = tasks.join_next().await {
let Ok(res) = res else { continue; };
let Ok(res) = res else {
continue;
};

if let Some(pkg) = res {
let _ = tx.send(pkg);
Expand Down

0 comments on commit 6314fe0

Please sign in to comment.