Move collect calls up in get_collection_from_file

This commit is contained in:
Reinout Meliesie 2024-11-30 16:01:10 +01:00
parent 1e9ff1057a
commit 183efaa047
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6

View file

@ -33,7 +33,7 @@ pub fn get_collection_from_file () -> Result <Collection> {
poster_file_path ,
video_file_path ,
} )
} ) ;
} ) . collect () ? ;
let mut series_query = sqlite_connection . prepare ("select * from series") ? ;
let series = series_query . query (()) ? . map ( |row| {
@ -44,12 +44,9 @@ pub fn get_collection_from_file () -> Result <Collection> {
. map ( PathBuf :: from ) ;
Ok ( Series { uuid , name , original_name , poster_file_path } )
} ) ;
} ) . collect () ? ;
Ok ( Collection {
films : films . collect () ? ,
series : series . collect () ? ,
} )
Ok ( Collection { films , series } )
}
impl From <Error> for ZoodexError {