Skip to content

Commit

Permalink
chore: code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatisseB committed Feb 27, 2025
1 parent 4184c03 commit d3fb4c9
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions libs/lgc-common/src/plugins/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,19 @@ impl PluginManager {

pub fn plugin_names(&self, base_dir: impl AsRef<path::Path>) -> anyhow::Result<Vec<String>> {
fs::read_dir(base_dir)
.map(|entries| {
entries.filter_map(|entry| {
let path = entry.ok()?.path();
if path.extension()?.to_str()? == "wasm" {
path.file_stem()?.to_str().map(String::from)
} else {
None
}
}).collect()
})
.map_err(|e| e.into())
.map(|entries| {
entries
.filter_map(|entry| {
let path = entry.ok()?.path();
if path.extension()?.to_str()? == "wasm" {
path.file_stem()?.to_str().map(String::from)
} else {
None
}
})
.collect()
})
.map_err(|e| e.into())
}
}

Expand Down

0 comments on commit d3fb4c9

Please sign in to comment.