remove panic from UnsharedMemory

This commit is contained in:
Patrick Ventuzelo
2019-09-17 17:46:36 +02:00
parent c660aa9fce
commit 374f81972a

View File

@ -231,7 +231,11 @@ impl UnsharedMemory {
MemoryType::Static => {
UnsharedMemoryStorage::Static(StaticMemory::new(desc, &mut local)?)
}
MemoryType::SharedStatic => panic!("attempting to create shared unshared memory"),
MemoryType::SharedStatic => {
return Err(CreationError::InvalidDescriptor(
"attempting to create shared unshared memory".to_string(),
));
}
};
Ok(Self {