This repository was archived by the owner on Jan 17, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -164,15 +164,16 @@ fn do_main() -> Result<(), Error> {
164164 matches. is_present ( "enforce_stack_adjustment" ) ,
165165 matches. value_of ( "shrink_stack" ) . unwrap_or_else ( || "49152" ) . parse ( )
166166 . expect ( "New stack size is not valid u32" ) ,
167- matches. is_present ( "skip_optimization" ) ) . map_err ( Error :: Build ) ?;
167+ matches. is_present ( "skip_optimization" ) ,
168+ ) . map_err ( Error :: Build ) ?;
168169
169170 if let Some ( save_raw_path) = matches. value_of ( "save_raw" ) {
170171 parity_wasm:: serialize_to_file ( save_raw_path, module. clone ( ) ) . map_err ( Error :: Encoding ) ?;
171172 }
172173
173174 parity_wasm:: serialize_to_file (
174175 & path,
175- ctor_module. expect ( "ctor_module shouldn 't be None, b/c 'constructor' argument is set to true in build" )
176+ ctor_module. expect ( "ctor_module can 't be None, because 'constructor' argument is set to true in build" ) ,
176177 ) . map_err ( Error :: Encoding ) ?;
177178 Ok ( ( ) )
178179}
Original file line number Diff line number Diff line change @@ -10,11 +10,10 @@ use super::{
1010 inject_runtime_type,
1111 PackingError ,
1212 OptimizerError
13- } ;
13+ } ;
1414use parity_wasm;
1515use parity_wasm:: elements;
1616
17-
1817#[ derive( Debug ) ]
1918pub enum Error {
2019 Encoding ( elements:: Error ) ,
@@ -70,7 +69,8 @@ pub fn build(
7069 mut public_api_entries : Vec < & str > ,
7170 enforce_stack_adjustment : bool ,
7271 stack_size : u32 ,
73- skip_optimization : bool ) -> Result < ( elements:: Module , Option < elements:: Module > ) , Error > {
72+ skip_optimization : bool
73+ ) -> Result < ( elements:: Module , Option < elements:: Module > ) , Error > {
7474
7575 if let Target :: Emscripten = target {
7676 module = ununderscore_funcs ( module) ;
@@ -111,9 +111,10 @@ pub fn build(
111111 if !skip_optimization {
112112 optimize ( & mut ctor_module, vec ! [ CREATE_SYMBOL ] ) ?;
113113 }
114- let ctor_module =
115- pack_instance (
116- parity_wasm:: serialize ( module. clone ( ) ) . map_err ( Error :: Encoding ) ?, ctor_module. clone ( ) ) ?;
114+ let ctor_module = pack_instance (
115+ parity_wasm:: serialize ( module. clone ( ) ) . map_err ( Error :: Encoding ) ?,
116+ ctor_module. clone ( ) ,
117+ ) ?;
117118 Ok ( ( module, Some ( ctor_module) ) )
118119 } else {
119120 Ok ( ( module, None ) )
You can’t perform that action at this time.
0 commit comments