mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
Fix lint warnings/errors
This commit is contained in:
committed by
Manos Pitsidianakis
parent
5d7767fdb5
commit
3e9de243a5
2
lib/api/src/js/externals/memory.rs
vendored
2
lib/api/src/js/externals/memory.rs
vendored
@@ -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)?;
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user