@@ -246,7 +246,12 @@ impl EmbeddedAssets {
246246 pub fn new (
247247 input : impl Into < EmbeddedAssetsInput > ,
248248 options : & AssetOptions ,
249- map : impl Fn ( & AssetKey , & Path , & mut Vec < u8 > , & mut CspHashes ) -> Result < ( ) , EmbeddedAssetsError > ,
249+ mut map : impl FnMut (
250+ & AssetKey ,
251+ & Path ,
252+ & mut Vec < u8 > ,
253+ & mut CspHashes ,
254+ ) -> Result < ( ) , EmbeddedAssetsError > ,
250255 ) -> Result < Self , EmbeddedAssetsError > {
251256 // we need to pre-compute all files now, so that we can inject data from all files into a few
252257 let RawEmbeddedAssets { paths, csp_hashes } = RawEmbeddedAssets :: new ( input. into ( ) , options) ?;
@@ -262,7 +267,8 @@ impl EmbeddedAssets {
262267 assets : HashMap :: new ( ) ,
263268 } ,
264269 move |mut state, ( prefix, entry) | {
265- let ( key, asset) = Self :: compress_file ( & prefix, entry. path ( ) , & map, & mut state. csp_hashes ) ?;
270+ let ( key, asset) =
271+ Self :: compress_file ( & prefix, entry. path ( ) , & mut map, & mut state. csp_hashes ) ?;
266272 state. assets . insert ( key, asset) ;
267273 Result :: < _ , EmbeddedAssetsError > :: Ok ( state)
268274 } ,
@@ -292,7 +298,12 @@ impl EmbeddedAssets {
292298 fn compress_file (
293299 prefix : & Path ,
294300 path : & Path ,
295- map : & impl Fn ( & AssetKey , & Path , & mut Vec < u8 > , & mut CspHashes ) -> Result < ( ) , EmbeddedAssetsError > ,
301+ map : & mut impl FnMut (
302+ & AssetKey ,
303+ & Path ,
304+ & mut Vec < u8 > ,
305+ & mut CspHashes ,
306+ ) -> Result < ( ) , EmbeddedAssetsError > ,
296307 csp_hashes : & mut CspHashes ,
297308 ) -> Result < Asset , EmbeddedAssetsError > {
298309 let mut input = std:: fs:: read ( path) . map_err ( |error| EmbeddedAssetsError :: AssetRead {
0 commit comments