@@ -138,7 +138,7 @@ impl RustApp {
138138 . get ( ATTR_HREF )
139139 . map ( |attr| {
140140 let mut path = PathBuf :: new ( ) ;
141- path. extend ( attr. split ( '/' ) ) ;
141+ path. extend ( attr. value . split ( '/' ) ) ;
142142 if !path. is_absolute ( ) {
143143 path = html_dir. join ( path) ;
144144 }
@@ -148,21 +148,23 @@ impl RustApp {
148148 path
149149 } )
150150 . unwrap_or_else ( || html_dir. join ( "Cargo.toml" ) ) ;
151- let bin = attrs. get ( "data-bin" ) . map ( |val| val. to_string ( ) ) ;
152- let target_name = attrs. get ( "data-target-name" ) . map ( |val| val. to_string ( ) ) ;
151+ let bin = attrs. get ( "data-bin" ) . map ( |attr| attr. value . to_string ( ) ) ;
152+ let target_name = attrs
153+ . get ( "data-target-name" )
154+ . map ( |attr| attr. value . to_string ( ) ) ;
153155 let keep_debug = attrs. contains_key ( "data-keep-debug" ) ;
154156 let typescript = attrs. contains_key ( "data-typescript" ) ;
155157 let no_demangle = attrs. contains_key ( "data-no-demangle" ) ;
156158 let app_type = attrs
157159 . get ( "data-type" )
158- . map ( |s| s . parse ( ) )
160+ . map ( |attr| attr . value . parse ( ) )
159161 . transpose ( ) ?
160162 . unwrap_or ( RustAppType :: Main ) ;
161163 let reference_types = attrs. contains_key ( "data-reference-types" ) ;
162164 let weak_refs = attrs. contains_key ( "data-weak-refs" ) ;
163165 let wasm_opt = attrs
164166 . get ( "data-wasm-opt" )
165- . map ( |val| val . parse ( ) )
167+ . map ( |attr| attr . value . parse ( ) )
166168 . transpose ( ) ?
167169 . unwrap_or_else ( || {
168170 if cfg. release {
@@ -174,20 +176,20 @@ impl RustApp {
174176 let wasm_opt_params = attrs
175177 . get ( "data-wasm-opt-params" )
176178 . iter ( )
177- . flat_map ( |val| val . split_whitespace ( ) )
179+ . flat_map ( |attr| attr . value . split_whitespace ( ) )
178180 . map ( |val| val. to_string ( ) )
179181 . collect ( ) ;
180182 let wasm_bindgen_target = attrs
181183 . get ( "data-bindgen-target" )
182- . map ( |s| s . parse ( ) )
184+ . map ( |attr| attr . value . parse ( ) )
183185 . transpose ( ) ?
184186 . unwrap_or ( match app_type {
185187 RustAppType :: Main => WasmBindgenTarget :: Web ,
186188 RustAppType :: Worker => WasmBindgenTarget :: NoModules ,
187189 } ) ;
188190 let cross_origin = attrs
189191 . get ( "data-cross-origin" )
190- . map ( |val | CrossOrigin :: from_str ( val ) )
192+ . map ( |attr | CrossOrigin :: from_str ( & attr . value ) )
191193 . transpose ( ) ?
192194 . unwrap_or_default ( ) ;
193195 let integrity = IntegrityType :: from_attrs ( & attrs, & cfg) ?;
@@ -214,8 +216,9 @@ impl RustApp {
214216
215217 let cargo_profile = match data_cargo_profile {
216218 Some ( cargo_profile) => {
219+ let cargo_profile = & cargo_profile. value ;
217220 if let Some ( config_cargo_profile) = & cfg. cargo_profile {
218- log:: warn!( "Cargo profile from configuration ({config_cargo_profile}) will be overridden with HTML file's more specific setting ({cargo_profile })" ) ;
221+ log:: warn!( "Cargo profile from configuration ({config_cargo_profile}) will be overridden with HTML file's more specific setting ({})" , cargo_profile ) ;
219222 }
220223 Some ( cargo_profile. clone ( ) )
221224 }
@@ -224,7 +227,9 @@ impl RustApp {
224227
225228 // cargo features
226229
227- let data_features = attrs. get ( "data-cargo-features" ) . map ( |val| val. to_string ( ) ) ;
230+ let data_features = attrs
231+ . get ( "data-cargo-features" )
232+ . map ( |attr| attr. value . to_string ( ) ) ;
228233 let data_all_features = attrs. contains_key ( "data-cargo-all-features" ) ;
229234 let data_no_default_features = attrs. contains_key ( "data-cargo-no-default-features" ) ;
230235
@@ -254,13 +259,16 @@ impl RustApp {
254259 // bindings
255260
256261 let import_bindings = !attrs. contains_key ( "data-wasm-no-import" ) ;
257- let import_bindings_name = attrs. get ( "data-wasm-import-name" ) . cloned ( ) ;
262+ let import_bindings_name = attrs
263+ . get ( "data-wasm-import-name" )
264+ . map ( |attr| & attr. value )
265+ . cloned ( ) ;
258266
259267 // progress function
260268
261269 let initializer = attrs
262270 . get ( "data-initializer" )
263- . map ( |path| PathBuf :: from_str ( path) )
271+ . map ( |path| PathBuf :: from_str ( & path. value ) )
264272 . transpose ( ) ?
265273 . map ( |path| {
266274 if !path. is_absolute ( ) {
@@ -403,7 +411,7 @@ impl RustApp {
403411 ] ;
404412 if let Some ( profile) = & self . cargo_profile {
405413 args. push ( "--profile" ) ;
406- args. push ( profile) ;
414+ args. push ( & profile) ;
407415 } else if self . cfg . release {
408416 args. push ( "--release" ) ;
409417 }
0 commit comments