Skip to content

Commit 2b9c48d

Browse files
committed
Favor if let instead of is_some + unwrap
1 parent 8ae6fe1 commit 2b9c48d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/cli-support/src/wasm2es6js.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl Config {
2929
self.base64 = base64;
3030
self
3131
}
32-
32+
3333
pub fn fetch(&mut self, path: Option<String>) -> &mut Self {
3434
self.fetch_path = path;
3535
self
@@ -195,7 +195,7 @@ impl Output {
195195
.then(obj => {{
196196
wasm = obj.instance;
197197
{memory}
198-
}})",
198+
}})",
199199
imports = imports,
200200
memory = if export_mem { "memory = wasm.exports.memory;" } else { "" },
201201
);
@@ -213,12 +213,12 @@ impl Output {
213213
}}", base64 = base64::encode(&wasm)),
214214
inst
215215
)
216-
} else if self.fetch_path.is_some() {
216+
} else if let Some(ref path) = self.fetch_path {
217217
(
218218
String::new(),
219219
format!("fetch('{path}')
220220
.then(res => res.arrayBuffer())
221-
.then(bytes => {inst})", path = self.fetch_path.unwrap(), inst = inst)
221+
.then(bytes => {inst})", path = path, inst = inst)
222222
)
223223
} else {
224224
panic!("the option --base64 or --fetch is required");

0 commit comments

Comments
 (0)