Fixed clippy warning on using Self

This commit is contained in:
ptitSeb
2022-09-07 10:36:44 +02:00
parent 516da67ce8
commit 04a03fc524

View File

@ -453,7 +453,7 @@ impl VMMemory {
/// ///
/// This creates a `Memory` with owned metadata: this can be used to create a memory /// This creates a `Memory` with owned metadata: this can be used to create a memory
/// that will be imported into Wasm modules. /// that will be imported into Wasm modules.
pub fn new(memory: &MemoryType, style: &MemoryStyle) -> Result<VMMemory, MemoryError> { pub fn new(memory: &MemoryType, style: &MemoryStyle) -> Result<Self, MemoryError> {
Ok(if memory.shared { Ok(if memory.shared {
Self(Box::new(VMSharedMemory::new(memory, style)?)) Self(Box::new(VMSharedMemory::new(memory, style)?))
} else { } else {
@ -477,7 +477,7 @@ impl VMMemory {
memory: &MemoryType, memory: &MemoryType,
style: &MemoryStyle, style: &MemoryStyle,
vm_memory_location: NonNull<VMMemoryDefinition>, vm_memory_location: NonNull<VMMemoryDefinition>,
) -> Result<VMMemory, MemoryError> { ) -> Result<Self, MemoryError> {
Ok(if memory.shared { Ok(if memory.shared {
Self(Box::new(VMSharedMemory::from_definition( Self(Box::new(VMSharedMemory::from_definition(
memory, memory,