Move collect calls up in get_collection_from_file
This commit is contained in:
parent
1e9ff1057a
commit
183efaa047
1 changed files with 3 additions and 6 deletions
|
@ -33,7 +33,7 @@ pub fn get_collection_from_file () -> Result <Collection> {
|
||||||
poster_file_path ,
|
poster_file_path ,
|
||||||
video_file_path ,
|
video_file_path ,
|
||||||
} )
|
} )
|
||||||
} ) ;
|
} ) . collect () ? ;
|
||||||
|
|
||||||
let mut series_query = sqlite_connection . prepare ("select * from series") ? ;
|
let mut series_query = sqlite_connection . prepare ("select * from series") ? ;
|
||||||
let series = series_query . query (()) ? . map ( |row| {
|
let series = series_query . query (()) ? . map ( |row| {
|
||||||
|
@ -44,12 +44,9 @@ pub fn get_collection_from_file () -> Result <Collection> {
|
||||||
. map ( PathBuf :: from ) ;
|
. map ( PathBuf :: from ) ;
|
||||||
|
|
||||||
Ok ( Series { uuid , name , original_name , poster_file_path } )
|
Ok ( Series { uuid , name , original_name , poster_file_path } )
|
||||||
} ) ;
|
} ) . collect () ? ;
|
||||||
|
|
||||||
Ok ( Collection {
|
Ok ( Collection { films , series } )
|
||||||
films : films . collect () ? ,
|
|
||||||
series : series . collect () ? ,
|
|
||||||
} )
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From <Error> for ZoodexError {
|
impl From <Error> for ZoodexError {
|
||||||
|
|
Loading…
Add table
Reference in a new issue