Skip to content

Commit 19edc4f

Browse files
committed
reflow formatting
1 parent 4e50668 commit 19edc4f

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

crates/wasm-pkg-client/src/local.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ impl PackageLoader for LocalBackend {
7171
let mut entries = tokio::fs::read_dir(&package_dir)
7272
.await
7373
.map_err(|e| registry_path_context(e, &package_dir))?;
74-
tracing::debug!("READ IT");
7574
while let Some(entry) = entries.next_entry().await? {
7675
let path = entry.path();
7776
if path.extension() != Some("wasm".as_ref()) {
@@ -141,6 +140,7 @@ impl PackagePublisher for LocalBackend {
141140
let mut out = tokio::fs::File::create(&path)
142141
.await
143142
.map_err(|e| registry_path_context(e, &path))?;
143+
println!("writing to {}", path.display());
144144
tokio::io::copy(&mut data, &mut out)
145145
.await
146146
.map_err(Error::IoError)

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::{
44
path::{Path, PathBuf},
55
};
66

7+
use ::toml::Value;
78
use serde::{Deserialize, Serialize};
89

910
use crate::{
@@ -136,16 +137,6 @@ impl Config {
136137
.map(|strat| strat.config_dir().join("wasm-pkg").join("config.toml"))
137138
}
138139

139-
// take relative paths (such as those provided by [`LocalConfig`]'s `root` field) and make them
140-
// absolute
141-
fn normalize_paths(mut self, config_file: &Path) -> Result<Self, Error> {
142-
for (_, registry_config) in self.registry_configs.iter_mut() {
143-
if let Some(local_config) = registry_config.backend_config::<LocalConfig>("local")? {}
144-
145-
if let Some(path) = backend_configs.get_mut("local").map(|v| v.get_mut("root")) {}
146-
}
147-
}
148-
149140
/// Reads config from a TOML file at the given path.
150141
pub async fn from_file(path: impl AsRef<Path>) -> Result<Self, Error> {
151142
let contents = tokio::fs::read_to_string(path)

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,18 @@ impl<'a> DependencyResolver<'a> {
556556
// the version requirement; this can happen when packages are yanked. If we did
557557
// find an exact match, return the digest for comparison after fetching the
558558
// release
559-
find_latest_release(versions, &exact_req).map(|v| (&v.version, Some(digest))).or_else(|| find_latest_release(versions, &dependency.version).map(|v| (&v.version, None)))
560-
}
559+
find_latest_release(versions, &exact_req)
560+
.map(|v| (&v.version, Some(digest)))
561+
.or_else(|| find_latest_release(versions, &dependency.version).map(|v| (&v.version, None)))
562+
}
561563
None => find_latest_release(versions, &dependency.version).map(|v| (&v.version, None)),
562-
}.with_context(|| format!("component registry package `{name}` has no release matching version requirement `{version}`", name = dependency.package, version = dependency.version))?
564+
}.with_context(||
565+
format!(
566+
"component registry package `{name}` has no release matching version requirement `{version}`",
567+
name = dependency.package,
568+
version = dependency.version
569+
)
570+
)?
563571
};
564572

565573
// We need to clone a handle to the client because we mutably borrow self above. Might

0 commit comments

Comments
 (0)