Clippy fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-01-02 11:25:36 +01:00
parent f2b0d3b9f3
commit aae41b93bb
11 changed files with 18 additions and 19 deletions

View File

@@ -58,7 +58,7 @@ impl<T: ValueIdentifiable + ?Sized> ExternRef<T> {
/// Returns the real value for a given ExternRef. Note that the requested type must be the same as the type of the
/// value when it was passed before. If these types do not match, this will panic.
pub fn value_func<'a, 'b>(&'a self, env: &'b FunctionEnvMut<WebAssemblyEnv>) -> Option<&'b T>
pub fn value_func<'a>(&self, env: &'a FunctionEnvMut<WebAssemblyEnv>) -> Option<&'a T>
where
T: Sized + 'static,
{
@@ -85,7 +85,7 @@ impl<T: ValueIdentifiable + ?Sized> ExternRef<T> {
/// Returns the real value for a given ExternRef. Note that the requested type must be the same as the type of the
/// value when it was passed before. If these types do not match, this will panic.
pub fn value<'a, 'b, 'c>(&'a self, env: &'b Arc<WebAssemblyEnvironmentData>) -> Option<&'c T>
pub fn value<'a>(&self, env: &Arc<WebAssemblyEnvironmentData>) -> Option<&'a T>
where
T: Sized + 'static,
{

View File

@@ -382,7 +382,7 @@ impl WebAssemblyEnvironmentData {
pub fn get_extern_vec_ref_extern_ref(&self, extern_vec_ref: usize, index: usize) -> usize {
let r = self.extern_vec_ref_lookup.read();
let v = r.get(&extern_vec_ref).unwrap();
v[index as usize]
v[index]
}
/// Gets the extern ref index belonging to a specific pointer. If none exists, this will create
@@ -393,7 +393,7 @@ impl WebAssemblyEnvironmentData {
ptr: value as *const dyn Any,
is_vec,
}) {
return *v as usize;
return *v;
}
let index = {
let mut extern_ref_guard = self.extern_ref_pointers.write();
@@ -416,7 +416,7 @@ impl WebAssemblyEnvironmentData {
/// Gets a value from the extern ref lookup. This turns an earlier registered index back into
/// its proper value, validates its type, and returns the value.
pub fn get_extern_ref_value<'a, 'b, T: ?Sized>(&'a self, index: usize) -> &'b dyn Any {
pub fn get_extern_ref_value<'a, T: ?Sized>(&self, index: usize) -> &'a dyn Any {
let read_guard = self.extern_ref_pointers.read();
let ptr = read_guard.get(index - 1).unwrap();
if self