fix warnings

This commit is contained in:
NikVolf 2019-07-17 17:01:15 +03:00
parent 2c173fee26
commit 026b0502bb
3 changed files with 7 additions and 7 deletions

View File

@ -853,9 +853,9 @@ mod tests {
let rtype = &**rfunc.type_ref.read(); let rtype = &**rfunc.type_ref.read();
let elements::Type::Function(ref ftype) = rtype; let elements::Type::Function(ref ftype) = rtype;
/// import deleted so now it's func #0 // import deleted so now it's func #0
assert_eq!(rfunc.order(), Some(0)); assert_eq!(rfunc.order(), Some(0));
/// type should be the same, #1 // type should be the same, #1
assert_eq!(ftype.params().len(), 1); assert_eq!(ftype.params().len(), 1);
} }
} }

View File

@ -196,7 +196,7 @@ impl<T> RefList<T> {
} }
fn done_delete(&mut self, indices: &[usize]) { fn done_delete(&mut self, indices: &[usize]) {
for mut entry in self.items.iter_mut() { for entry in self.items.iter_mut() {
let mut entry = entry.write(); let mut entry = entry.write();
let total_less = indices.iter() let total_less = indices.iter()
.take_while(|x| **x < entry.order().expect("Items in the list always have order; qed")) .take_while(|x| **x < entry.order().expect("Items in the list always have order; qed"))
@ -209,7 +209,7 @@ impl<T> RefList<T> {
let mut total_removed = 0; let mut total_removed = 0;
for idx in indices { for idx in indices {
let mut detached = self.items.remove(*idx - total_removed); let detached = self.items.remove(*idx - total_removed);
detached.write().index = EntryOrigin::Detached; detached.write().index = EntryOrigin::Detached;
total_removed += 1; total_removed += 1;
} }

View File

@ -214,7 +214,7 @@ fn instrument_functions(ctx: &mut Context, module: &mut elements::Module) -> Res
for section in module.sections_mut() { for section in module.sections_mut() {
if let elements::Section::Code(ref mut code_section) = *section { if let elements::Section::Code(ref mut code_section) = *section {
for func_body in code_section.bodies_mut() { for func_body in code_section.bodies_mut() {
let mut opcodes = func_body.code_mut(); let opcodes = func_body.code_mut();
instrument_function(ctx, opcodes)?; instrument_function(ctx, opcodes)?;
} }
} }