Skip to content

Commit

Permalink
chore: Formatting/linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
theduke committed Sep 26, 2024
1 parent f1a0879 commit 1834827
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/wasix/src/runners/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ mod tests {

let fs = &init.state.fs.root_fs;

fs.read_dir(&std::path::Path::new("/host")).unwrap();
fs.read_dir(std::path::Path::new("/host")).unwrap();
}

#[cfg(all(feature = "host-fs", feature = "sys"))]
Expand Down Expand Up @@ -535,7 +535,7 @@ mod tests {

let fs = &init.state.fs.root_fs;

fs.read_dir(&std::path::Path::new("/host")).unwrap();
fs.read_dir(&std::path::Path::new("/settings")).unwrap();
fs.read_dir(std::path::Path::new("/host")).unwrap();
fs.read_dir(std::path::Path::new("/settings")).unwrap();
}
}
2 changes: 1 addition & 1 deletion lib/wasix/src/runtime/package_loader/builtin_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ mod test {
let path = dir.path();

let contents = "fail";
let correct_hash = WebcHash::sha256(&contents);
let correct_hash = WebcHash::sha256(contents);
let used_hash =
WebcHash::parse_hex("0000a28ea38a000f3a3328cb7fabe330638d3258affe1a869e3f92986222d997")
.unwrap();
Expand Down
6 changes: 3 additions & 3 deletions lib/wasix/src/runtime/resolver/in_memory_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ impl InMemorySource {
let pkg_hash = PackageHash::Sha256(wasmer_config::hash::Sha256Hash(
summary.dist.webc_sha256.as_bytes(),
));
if !self.hash_packages.contains_key(&pkg_hash) {
self.hash_packages.insert(pkg_hash, summary.clone());
}
self.hash_packages
.entry(pkg_hash)
.or_insert_with(|| summary.clone());

// Add the named package.
let summaries = self
Expand Down
6 changes: 6 additions & 0 deletions lib/wasix/src/runtime/resolver/multi_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ pub struct MultiSource {
strategy: MultiSourceStrategy,
}

impl Default for MultiSource {
fn default() -> Self {
Self::new()
}
}

impl MultiSource {
pub fn new() -> Self {
MultiSource {
Expand Down
3 changes: 1 addition & 2 deletions lib/wasix/tests/runners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,8 @@ fn client() -> Client {
}
builder
};
let client = builder.build().unwrap();

client
builder.build().unwrap()
}

#[cfg(not(target_os = "windows"))]
Expand Down

0 comments on commit 1834827

Please sign in to comment.