Skip to content

Commit

Permalink
fix more clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
danleh committed Jul 26, 2024
1 parent d4c31bd commit ac92fb5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions crates/wasabi/src/instrument/add_hooks/static_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ impl<'a> From<&'a Module> for ModuleInfo {
// if the module has no table, there cannot be a call_indirect, so this null will never be read from JS runtime
table_export_name: module
.tables
.get(0)
.and_then(|table| table.export.get(0).cloned()),
.first()
.and_then(|table| table.export.first().cloned()),
br_tables: vec![],
original_function_imports_count: module
.functions
Expand Down
9 changes: 3 additions & 6 deletions crates/wasabi_wasm/src/encode.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Code for encoding our AST back to the WebAssembly binary format.
//! Uses `wasm-encoder` for the actual low-level work.
use std::convert::TryInto;
use std::sync::RwLock;

use nohash_hasher::IntMap;
Expand Down Expand Up @@ -728,11 +727,10 @@ impl From<Limits> for we::MemoryType {
Self {
minimum: limits
.initial_size
.try_into()
.expect("u32 to u64 should always succeed"),
.into(),
maximum: limits
.max_size
.map(|u32| u32.try_into().expect("u32 to u64 should always succeed")),
.map(|u32| u32.into()),
memory64: false,
shared: false,
}
Expand All @@ -756,8 +754,7 @@ impl From<Memarg> for we::MemArg {
Self {
offset: hl_memarg
.offset
.try_into()
.expect("u32 to u64 should always succeed"),
.into(),
align: hl_memarg.alignment_exp.into(),
memory_index: 0,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/wasabi_wasm/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ impl<'module> TypeChecker<'module> {
e.0.instruction_idx = Some(instr_idx.into());
e.0.instruction = Some(instr.clone());

e.0.function_name = function.name.clone();
e.0.function_name.clone_from(&function.name);

e
})?;
Expand Down

0 comments on commit ac92fb5

Please sign in to comment.