Fix lint warnings/errors

This commit is contained in:
ptitSeb
2022-06-08 15:18:50 +02:00
committed by Manos Pitsidianakis
parent 5d7767fdb5
commit 3e9de243a5
32 changed files with 2304 additions and 2383 deletions

View File

@@ -339,7 +339,7 @@ impl Memory {
.len()
.try_into()
.map_err(|_| MemoryAccessError::Overflow)?;
let view = self.uint8view();
let view = self.uint8view();
let end = offset.checked_add(len).ok_or(MemoryAccessError::Overflow)?;
if end > view.length() {
Err(MemoryAccessError::HeapOutOfBounds)?;

View File

@@ -88,7 +88,11 @@ impl<'a, T: ValueType> WasmRef<'a, T> {
/// Get a `WasmPtr` fror this `WasmRef`.
#[inline]
pub fn as_ptr<M: MemorySize>(self) -> WasmPtr<T, M> {
let offset: M::Offset = self.offset.try_into().map_err(|_| "invalid offset into memory").unwrap();
let offset: M::Offset = self
.offset
.try_into()
.map_err(|_| "invalid offset into memory")
.unwrap();
WasmPtr::<T, M>::new(offset)
}