File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " wasmi"
3
- version = " 0.7 .0"
3
+ version = " 0.8 .0"
4
4
edition = " 2018"
5
5
authors = [" Nikolay Volf <nikvolf@gmail.com>" , " Svyatoslav Nikolsky <svyatonik@yandex.ru>" , " Sergey Pepyakin <s.pepyakin@gmail.com>" ]
6
6
license = " MIT/Apache-2.0"
Original file line number Diff line number Diff line change @@ -121,15 +121,16 @@ impl MemoryInstance {
121
121
let initial_u32: u32 = initial. 0 . try_into ( ) . map_err ( |_| {
122
122
Error :: Memory ( format ! ( "initial ({}) can't be coerced to u32" , initial. 0 ) )
123
123
} ) ?;
124
- let maximum_u32: Option < u32 > = match maximum {
125
- Some ( maximum_pages) => Some ( maximum_pages. 0 . try_into ( ) . map_err ( |_| {
126
- Error :: Memory ( format ! (
127
- "maximum ({}) can't be coerced to u32" ,
128
- maximum_pages. 0
129
- ) )
130
- } ) ?) ,
131
- None => None ,
132
- } ;
124
+ let maximum_u32: Option < u32 > = maximum
125
+ . map ( |maximum_pages| {
126
+ maximum_pages. 0 . try_into ( ) . map_err ( |_| {
127
+ Error :: Memory ( format ! (
128
+ "maximum ({}) can't be coerced to u32" ,
129
+ maximum_pages. 0
130
+ ) )
131
+ } )
132
+ } )
133
+ . transpose ( ) ?;
133
134
validation:: validate_memory ( initial_u32, maximum_u32) . map_err ( Error :: Memory ) ?;
134
135
}
135
136
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ impl Validator for WasmiValidation {
43
43
/// Validate a module and compile it to the internal representation.
44
44
pub fn compile_module ( module : Module ) -> Result < CompiledModule , Error > {
45
45
let code_map = validate_module :: < WasmiValidation > ( & module) ?;
46
- Ok ( CompiledModule { module , code_map } )
46
+ Ok ( CompiledModule { code_map , module } )
47
47
}
48
48
49
49
/// Verify that the module doesn't use floating point instructions or types.
You can’t perform that action at this time.
0 commit comments