Tidy up unneeded '&'s.

This commit is contained in:
Dan Gohman
2019-01-03 11:31:36 -08:00
parent c66a3c23f3
commit 529de7ca60
6 changed files with 9 additions and 9 deletions

View File

@@ -74,7 +74,7 @@ impl Compiler {
SetupError,
> {
let (compilation, relocations) =
cranelift::compile_module(&module, function_body_inputs, &*self.isa)
cranelift::compile_module(module, function_body_inputs, &*self.isa)
.map_err(SetupError::Compile)?;
let allocated_functions =

View File

@@ -183,7 +183,7 @@ pub fn link_module(
}
// Apply relocations, now that we have virtual addresses for everything.
relocate(allocated_functions, relocations, &module);
relocate(allocated_functions, relocations, module);
Ok(Imports::new(
function_imports,

View File

@@ -65,7 +65,7 @@ impl Namespace {
field_name: &str,
args: &[RuntimeValue],
) -> Result<ActionOutcome, ActionError> {
invoke(compiler, &mut self.instances[index], &field_name, &args)
invoke(compiler, &mut self.instances[index], field_name, args)
}
/// Get a slice of memory from an instance.
@@ -76,12 +76,12 @@ impl Namespace {
start: usize,
len: usize,
) -> Result<&[u8], ActionError> {
inspect_memory(&self.instances[index], &field_name, start, len)
inspect_memory(&self.instances[index], field_name, start, len)
}
/// Get the value of an exported global from an instance.
pub fn get(&self, index: InstanceIndex, field_name: &str) -> Result<RuntimeValue, ActionError> {
get(&self.instances[index], &field_name)
get(&self.instances[index], field_name)
}
}

View File

@@ -570,7 +570,7 @@ impl Instance {
/// Return a reference to the vmctx used by compiled wasm code.
pub fn vmctx(&self) -> &VMContext {
&self.mmap_field.contents().vmctx()
self.mmap_field.contents().vmctx()
}
/// Return a raw pointer to the vmctx used by compiled wasm code.
@@ -818,7 +818,7 @@ fn create_memories(
let mut memories: PrimaryMap<DefinedMemoryIndex, _> =
PrimaryMap::with_capacity(module.memory_plans.len() - num_imports);
for plan in &module.memory_plans.values().as_slice()[num_imports..] {
memories.push(LinearMemory::new(&plan).map_err(InstantiationError::Resource)?);
memories.push(LinearMemory::new(plan).map_err(InstantiationError::Resource)?);
}
Ok(memories.into_boxed_slice())
}

View File

@@ -193,7 +193,7 @@ impl WastContext {
.collect::<Vec<_>>();
let index = self.get_index(&instance_name)?;
self.namespace
.invoke(&mut *self.compiler, index, &field, &value_args)
.invoke(&mut *self.compiler, index, field, &value_args)
.map_err(WastError::Action)
}

View File

@@ -168,7 +168,7 @@ fn handle_module(
// If a function to invoke was given, invoke it.
if let Some(ref f) = args.flag_invoke {
match namespace
.invoke(compiler, index, &f, &[])
.invoke(compiler, index, f, &[])
.map_err(|e| e.to_string())?
{
ActionOutcome::Returned { .. } => {}