From 90dcdfec1cee023ea0c0d67ee25227f0154c7c47 Mon Sep 17 00:00:00 2001 From: losfair Date: Mon, 19 Aug 2019 19:17:50 -0700 Subject: [PATCH] Cargo fmt --- lib/llvm-backend/src/stackmap.rs | 7 +++++-- lib/runtime-core/src/state.rs | 14 ++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/llvm-backend/src/stackmap.rs b/lib/llvm-backend/src/stackmap.rs index 7e4d515df..d2ccc3c0a 100644 --- a/lib/llvm-backend/src/stackmap.rs +++ b/lib/llvm-backend/src/stackmap.rs @@ -1,7 +1,7 @@ // https://llvm.org/docs/StackMaps.html#stackmap-section use byteorder::{LittleEndian, ReadBytesExt}; -use std::collections::{HashMap, BTreeMap}; +use std::collections::{BTreeMap, HashMap}; use std::io::{self, Cursor}; use wasmer_runtime_core::state::{ x64::{new_machine_state, X64Register, GPR}, @@ -231,7 +231,10 @@ impl StackmapEntry { if loc.offset_or_small_constant >= 0 { assert!(loc.offset_or_small_constant >= 16); // (saved_rbp, return_address) assert!(loc.offset_or_small_constant % 8 == 0); - prev_frame_diff.insert(((loc.offset_or_small_constant as usize - 16) / 8), Some(mv)); + prev_frame_diff.insert( + ((loc.offset_or_small_constant as usize - 16) / 8), + Some(mv), + ); } else { let stack_offset = ((-loc.offset_or_small_constant) / 4) as usize; assert!( diff --git a/lib/runtime-core/src/state.rs b/lib/runtime-core/src/state.rs index 580318842..31987fcca 100644 --- a/lib/runtime-core/src/state.rs +++ b/lib/runtime-core/src/state.rs @@ -217,17 +217,19 @@ impl MachineState { let prev_frame_diff: BTreeMap> = self .prev_frame .iter() - .filter(|(k, v)| if let Some(ref old_v) = old.prev_frame.get(k) { - v != old_v - } else { - true + .filter(|(k, v)| { + if let Some(ref old_v) = old.prev_frame.get(k) { + v != old_v + } else { + true + } }) .map(|(&k, v)| (k, Some(v.clone()))) .chain( old.prev_frame .iter() .filter(|(k, _)| self.prev_frame.get(k).is_none()) - .map(|(&k, _)| (k, None)) + .map(|(&k, _)| (k, None)), ) .collect(); let first_diff_wasm_stack_depth: usize = self @@ -978,7 +980,7 @@ pub mod x64 { MachineValue::WasmLocal(idx) => { wasm_locals[idx] = Some(*stack.offset(offset)); } - _ => unreachable!("values in prev frame can only be stack/local") + _ => unreachable!("values in prev frame can only be stack/local"), } } stack = stack.offset(1); // saved_rbp