Use dyn instead of generic for media_fn

Otherwise, would have to pass None with type annotation in the default
case.
This commit is contained in:
RumovZ 2022-04-08 18:46:40 +02:00
parent 08791e24fc
commit 468c0286f9

View file

@ -29,7 +29,7 @@ impl Collection {
search: impl TryIntoSearch,
with_scheduling: bool,
with_media: bool,
media_fn: Option<impl FnOnce(HashSet<PathBuf>) -> MediaIter>,
media_fn: Option<Box<dyn FnOnce(HashSet<PathBuf>) -> MediaIter>>,
progress_fn: impl FnMut(usize),
) -> Result<()> {
let temp_apkg = tempfile_in_parent_of(out_path.as_ref())?;