@@ -328,49 +328,49 @@ pub trait InputParse<'a> {
328328 /// Map function over each line
329329 fn mlines < F , U > ( self , f : F ) -> Vec < U >
330330 where
331- F : Fn ( & str ) -> U + ' static + Copy ;
331+ F : FnMut ( & str ) -> U ;
332332
333333 /// Apply regex to each line and map captures
334334 fn regex_mlines < F , U > ( self , re : Regex , f : F ) -> Vec < U >
335335 where
336- F : Fn ( Captures ) -> U + ' static + Copy ;
336+ F : FnMut ( Captures ) -> U + Copy ;
337337
338338 /// Parse to char grid `Vec<Vec<char>>`
339339 fn c_map ( self ) -> Vec < Vec < char > > ;
340340
341341 /// Parse to char grid with mapping function
342342 fn c_mmap < F , U > ( self , f : F ) -> Vec < Vec < U > >
343343 where
344- F : Fn ( char ) -> U + ' static + Copy ;
344+ F : FnMut ( char ) -> U + Copy ;
345345
346346 /// Split lines by whitespace to `Vec<Vec<&str>>`
347347 fn ws_map ( self ) -> Vec < Vec < & ' a str > > ;
348348
349349 /// Split lines by whitespace and map each token
350350 fn ws_mmap < F , U > ( self , f : F ) -> Vec < Vec < U > >
351351 where
352- F : Fn ( & str ) -> U + ' static + Copy ;
352+ F : FnMut ( & str ) -> U + Copy ;
353353
354354 /// Split input by double newlines
355355 fn blocks ( self ) -> Vec < & ' a str > ;
356356
357357 /// Split by double newlines and map each block
358358 fn mblocks < F , U > ( self , f : F ) -> Vec < U >
359359 where
360- F : Fn ( & str ) -> U + ' static + Copy ;
360+ F : FnMut ( & str ) -> U ;
361361}
362362
363363impl < ' a > InputParse < ' a > for & ' a str {
364364 fn mlines < F , U > ( self , f : F ) -> Vec < U >
365365 where
366- F : Fn ( & str ) -> U + ' static + Copy ,
366+ F : FnMut ( & str ) -> U ,
367367 {
368368 self . lines ( ) . map ( f) . collect_vec ( )
369369 }
370370
371371 fn regex_mlines < F , U > ( self , re : Regex , f : F ) -> Vec < U >
372372 where
373- F : Fn ( Captures ) -> U + ' static + Copy ,
373+ F : FnMut ( Captures ) -> U + Copy ,
374374 {
375375 self . lines ( )
376376 . map ( |l| re. captures ( l) . map ( f) . expect ( "Regex should work" ) )
@@ -383,7 +383,7 @@ impl<'a> InputParse<'a> for &'a str {
383383
384384 fn c_mmap < F , U > ( self , f : F ) -> Vec < Vec < U > >
385385 where
386- F : Fn ( char ) -> U + ' static + Copy ,
386+ F : FnMut ( char ) -> U + Copy ,
387387 {
388388 self . lines ( )
389389 . map ( |l| l. chars ( ) . map ( f) . collect_vec ( ) )
@@ -398,7 +398,7 @@ impl<'a> InputParse<'a> for &'a str {
398398
399399 fn ws_mmap < F , U > ( self , f : F ) -> Vec < Vec < U > >
400400 where
401- F : Fn ( & str ) -> U + ' static + Copy ,
401+ F : FnMut ( & str ) -> U + Copy ,
402402 {
403403 self . lines ( )
404404 . map ( |l| l. split_whitespace ( ) . map ( f) . collect_vec ( ) )
@@ -411,7 +411,7 @@ impl<'a> InputParse<'a> for &'a str {
411411
412412 fn mblocks < F , U > ( self , f : F ) -> Vec < U >
413413 where
414- F : Fn ( & str ) -> U + ' static + Copy ,
414+ F : FnMut ( & str ) -> U ,
415415 {
416416 self . split ( "\n \n " ) . map ( f) . collect_vec ( )
417417 }
0 commit comments