From f8c37044b122664a2ae9cd99f4bf83de80680c1d Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Fri, 17 Jul 2026 15:07:23 +0200 Subject: [PATCH] feat: accept path-like interrupt inputs Make input_with_interrupt_and_dictionary accept any AsRef, matching the other input helpers. --- src/format/mod.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/format/mod.rs b/src/format/mod.rs index 63879786..f012ce81 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -229,8 +229,8 @@ where } } -pub fn input_with_interrupt_and_dictionary( - path: &Path, +pub fn input_with_interrupt_and_dictionary + ?Sized, F>( + path: &P, closure: F, options: Dictionary, ) -> Result @@ -528,3 +528,19 @@ pub fn output_to_stream( } } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn input_with_interrupt_and_dictionary_accepts_str_path() { + let result = input_with_interrupt_and_dictionary( + "/ffmpeg-next-input-does-not-exist", + || false, + Dictionary::new(), + ); + + assert!(result.is_err()); + } +}