@@ -133,7 +133,7 @@ pub trait DecryptReadBackend: ReadBackend + Clone + 'static {
133133 /// # Errors
134134 ///
135135 /// * If the file could not be read.
136- fn get_file < F : RepoFile > ( & self , id : & Id ) -> RusticResult < F > {
136+ fn get_file < F : RepoFile > ( & self , id : & F :: Id ) -> RusticResult < F > {
137137 let data = if F :: ENCRYPTED {
138138 self . read_encrypted_full ( F :: TYPE , id) ?
139139 } else {
@@ -163,6 +163,7 @@ pub trait DecryptReadBackend: ReadBackend + Clone + 'static {
163163 /// If the files could not be read.
164164 fn stream_all < F : RepoFile > ( & self , p : & impl Progress ) -> StreamResult < F :: Id , F > {
165165 let list = self . list ( F :: TYPE ) ?;
166+ let list: Vec < _ > = list. into_iter ( ) . map ( F :: Id :: from) . collect ( ) ;
166167 self . stream_list ( & list, p)
167168 }
168169
@@ -178,13 +179,17 @@ pub trait DecryptReadBackend: ReadBackend + Clone + 'static {
178179 /// # Errors
179180 ///
180181 /// If the files could not be read.
181- fn stream_list < F : RepoFile > ( & self , list : & [ Id ] , p : & impl Progress ) -> StreamResult < F :: Id , F > {
182+ fn stream_list < F : RepoFile > (
183+ & self ,
184+ list : & [ F :: Id ] ,
185+ p : & impl Progress ,
186+ ) -> StreamResult < F :: Id , F > {
182187 p. set_length ( list. len ( ) as u64 ) ;
183188 let ( tx, rx) = unbounded ( ) ;
184189
185190 list. into_par_iter ( )
186191 . for_each_with ( ( self , p, tx) , |( be, p, tx) , id| {
187- let file = be. get_file :: < F > ( id) . map ( |file| ( F :: Id :: from ( * id) , file) ) ;
192+ let file = be. get_file :: < F > ( id) . map ( |file| ( * id, file) ) ;
188193 p. inc ( 1 ) ;
189194 tx. send ( file) . unwrap ( ) ;
190195 } ) ;
0 commit comments