Print value that can't be coerced to u32
This commit is contained in:
parent
ddbeba0154
commit
cd34cc6afb
|
@ -113,13 +113,17 @@ impl MemoryInstance {
|
|||
let initial_u32: u32 = initial
|
||||
.0
|
||||
.try_into()
|
||||
.map_err(|_| Error::Memory("initial can't be coerced to u32".into()))?;
|
||||
.map_err(|_| Error::Memory(format!("initial ({}) can't be coerced to u32", initial.0)))?;
|
||||
let maximum_u32: Option<u32> = match maximum {
|
||||
Some(pages) => Some(
|
||||
pages
|
||||
Some(maximum_pages) => Some(
|
||||
maximum_pages
|
||||
.0
|
||||
.try_into()
|
||||
.map_err(|_| Error::Memory("maximum can't be coerced to u32".into()))?,
|
||||
.map_err(|_|
|
||||
Error::Memory(
|
||||
format!("maximum ({}) can't be coerced to u32", maximum_pages.0)
|
||||
)
|
||||
)?,
|
||||
),
|
||||
None => None,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue