Add support for optional bools

This commit is contained in:
Anton Danilkin
2018-08-03 19:07:12 +03:00
committed by Alex Crichton
parent 0ef528165f
commit 4a0c69ffed
5 changed files with 74 additions and 4 deletions

View File

@ -220,6 +220,16 @@ impl FromWasmAbi for bool {
}
}
impl OptionIntoWasmAbi for bool {
#[inline]
fn none() -> u32 { 0xFFFFFFu32 }
}
impl OptionFromWasmAbi for bool {
#[inline]
fn is_none(js: &u32) -> bool { *js == 0xFFFFFFu32 }
}
impl IntoWasmAbi for char {
type Abi = u32;