Skip to content

Commit e95b336

Browse files
committed
clippy
1 parent 465b4aa commit e95b336

4 files changed

Lines changed: 6 additions & 13 deletions

File tree

crates/wasm-pkg-core/src/config.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,8 @@ impl Config {
6464
let path = path.as_ref().canonicalize().ok();
6565
self.overrides
6666
.iter()
67-
.map(|map| map.iter())
68-
.flatten()
69-
.filter(|(_, o)| o.path.as_ref().map(|p| p.canonicalize().ok()).flatten() == path)
70-
.next()
67+
.flat_map(|map| map.iter())
68+
.find(|(_, o)| o.path.as_ref().and_then(|p| p.canonicalize().ok()) == path)
7169
.is_some()
7270
}
7371
}

crates/wasm-pkg-core/src/resolver.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@ use std::{
1212
use anyhow::{bail, Context, Result};
1313
use futures_util::TryStreamExt;
1414
use indexmap::{IndexMap, IndexSet};
15-
use petgraph::{
16-
acyclic::Acyclic,
17-
graph::NodeIndex,
18-
stable_graph::StableDiGraph,
19-
Direction,
20-
};
15+
use petgraph::{acyclic::Acyclic, graph::NodeIndex, stable_graph::StableDiGraph, Direction};
2116
use semver::{Comparator, Op, Version, VersionReq};
2217
use tokio::io::{AsyncRead, AsyncReadExt};
2318
use wasm_pkg_client::{

crates/wasm-pkg-core/src/wit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub async fn build_package(
7070
.await
7171
.map_err(|e| {
7272
if config.has_override(wit_dir.as_ref()) {
73-
e.context(format!("hint: override present for WIT directory"))
73+
e.context("hint: override present for WIT directory".to_string())
7474
} else {
7575
e
7676
}

crates/wkg/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ impl PublishArgs {
265265
let cache = self.common.load_cache().await?;
266266

267267
let local_config = LocalConfig::temp_dir()?;
268-
let reg_config =
269-
RegistryConfig::default().with_default_backend(LOCAL_PROTOCOL, &local_config)?;
268+
let reg_config = RegistryConfig::default()
269+
.with_default_backend(LOCAL_PROTOCOL, &local_config)?;
270270
// Route every package in the plan to the local overlay registry
271271
// backed by `reg_config`, so the client used in `build_wit_dir`
272272
// resolves these packages against the local overlay instead of

0 commit comments

Comments
 (0)