use fallible (instead of panicking) arg getter

This commit is contained in:
Brian Hicks 2022-08-10 06:09:49 -05:00
parent 0105fa4c4a
commit 91e8e45523
No known key found for this signature in database
GPG key ID: C4F324B9CAAB0D50

View file

@ -525,7 +525,9 @@ pub fn build(
}
let wasm_dev_stack_bytes: Option<u32> = matches
.value_of(FLAG_WASM_STACK_SIZE_KB)
.try_get_one::<&str>(FLAG_WASM_STACK_SIZE_KB)
.ok()
.flatten()
.and_then(|s| s.parse::<u32>().ok())
.map(|x| x * 1024);