File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use crate::Monoid;
33
44pub trait MapMonoid {
55 type M : Monoid ;
6- type F : Copy ;
6+ type F : Clone ;
77 // type S = <Self::M as Monoid>::S;
88 fn identity_element ( ) -> <Self :: M as Monoid >:: S {
99 Self :: M :: identity ( )
@@ -274,14 +274,14 @@ where
274274 self . d [ k] = F :: binary_operation ( self . d [ 2 * k] . clone ( ) , self . d [ 2 * k + 1 ] . clone ( ) ) ;
275275 }
276276 fn all_apply ( & mut self , k : usize , f : F :: F ) {
277- self . d [ k] = F :: mapping ( f, self . d [ k] . clone ( ) ) ;
277+ self . d [ k] = F :: mapping ( f. clone ( ) , self . d [ k] . clone ( ) ) ;
278278 if k < self . size {
279- self . lz [ k] = F :: composition ( f, self . lz [ k] ) ;
279+ self . lz [ k] = F :: composition ( f, self . lz [ k] . clone ( ) ) ;
280280 }
281281 }
282282 fn push ( & mut self , k : usize ) {
283- self . all_apply ( 2 * k, self . lz [ k] ) ;
284- self . all_apply ( 2 * k + 1 , self . lz [ k] ) ;
283+ self . all_apply ( 2 * k, self . lz [ k] . clone ( ) ) ;
284+ self . all_apply ( 2 * k + 1 , self . lz [ k] . clone ( ) ) ;
285285 self . lz [ k] = F :: identity_map ( ) ;
286286 }
287287}
You can’t perform that action at this time.
0 commit comments