Add clippy suggestions (#6203)
* add clippy suggestions * revert &/ref change * Update cranelift/isle/isle/src/parser.rs Co-authored-by: Jamey Sharp <jamey@minilop.net> --------- Co-authored-by: Jamey Sharp <jamey@minilop.net>
This commit is contained in:
@@ -151,9 +151,9 @@ impl Wasmtime {
|
||||
let mut gen = InterfaceGenerator::new(self, resolve);
|
||||
let import = match item {
|
||||
WorldItem::Function(func) => {
|
||||
gen.generate_function_trait_sig(TypeOwner::None, &func);
|
||||
gen.generate_function_trait_sig(TypeOwner::None, func);
|
||||
let sig = mem::take(&mut gen.src).into();
|
||||
gen.generate_add_function_to_linker(TypeOwner::None, &func, "linker");
|
||||
gen.generate_add_function_to_linker(TypeOwner::None, func, "linker");
|
||||
let add_to_linker = gen.src.into();
|
||||
Import::Function { sig, add_to_linker }
|
||||
}
|
||||
@@ -203,7 +203,7 @@ impl Wasmtime {
|
||||
let (_name, getter) = gen.extract_typed_function(func);
|
||||
assert!(gen.src.is_empty());
|
||||
self.exports.funcs.push(body);
|
||||
(format!("wasmtime::component::Func"), getter)
|
||||
("wasmtime::component::Func".to_string(), getter)
|
||||
}
|
||||
WorldItem::Type(_) => unreachable!(),
|
||||
WorldItem::Interface(id) => {
|
||||
@@ -1051,9 +1051,9 @@ impl<'a> InterfaceGenerator<'a> {
|
||||
uwriteln!(self.src, "}}");
|
||||
|
||||
let where_clause = if self.gen.opts.async_ {
|
||||
format!("T: Send, U: Host + Send")
|
||||
"T: Send, U: Host + Send".to_string()
|
||||
} else {
|
||||
format!("U: Host")
|
||||
"U: Host".to_string()
|
||||
};
|
||||
uwriteln!(
|
||||
self.src,
|
||||
@@ -1259,7 +1259,7 @@ impl<'a> InterfaceGenerator<'a> {
|
||||
|
||||
let ret = (snake, mem::take(&mut self.src).to_string());
|
||||
self.src = prev;
|
||||
return ret;
|
||||
ret
|
||||
}
|
||||
|
||||
fn define_rust_guest_export(&mut self, ns: Option<&str>, func: &Function) {
|
||||
|
||||
@@ -235,7 +235,7 @@ pub trait RustGenerator<'a> {
|
||||
if self.uses_two_names(&info) {
|
||||
result.push((self.param_name(ty), TypeMode::AllBorrowed("'a")));
|
||||
}
|
||||
return result;
|
||||
result
|
||||
}
|
||||
|
||||
/// Writes the camel-cased 'name' of the passed type to `out`, as used to name union variants.
|
||||
|
||||
@@ -95,7 +95,7 @@ impl Types {
|
||||
_ => continue,
|
||||
};
|
||||
if let Some(Type::Id(id)) = err {
|
||||
self.type_info.get_mut(&id).unwrap().error = true;
|
||||
self.type_info.get_mut(id).unwrap().error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user