finish the lint pass: allow what is contractual, fix what is not
This commit is contained in:
+19
-1
@@ -919,6 +919,12 @@ pub(crate) fn render_preview(
|
||||
|
||||
/// Render a GIF preview with actual palette and dithering applied.
|
||||
/// Generates a palette from the full clip, then applies it to a single frame.
|
||||
// Every argument is a distinct knob the caller already has in hand; bundling
|
||||
// them into a struct would only move the same list one level up.
|
||||
#[allow(
|
||||
clippy::too_many_arguments,
|
||||
reason = "flat parameter list mirrors the preview request fields the caller owns"
|
||||
)]
|
||||
pub(crate) fn render_gif_preview(
|
||||
ffmpeg: &Path,
|
||||
input: &Path,
|
||||
@@ -1111,6 +1117,8 @@ impl Drop for TempFileGuard {
|
||||
}
|
||||
|
||||
pub(crate) fn concat_segments(ffmpeg: &Path, segments: &[PathBuf], output: &Path) -> Result<()> {
|
||||
use std::fmt::Write as _;
|
||||
|
||||
if segments.is_empty() {
|
||||
bail!("no segments to concatenate");
|
||||
}
|
||||
@@ -1126,7 +1134,6 @@ pub(crate) fn concat_segments(ffmpeg: &Path, segments: &[PathBuf], output: &Path
|
||||
|
||||
let list_path = parent.join("concat-list.txt");
|
||||
let _guard = TempFileGuard(list_path.clone());
|
||||
use std::fmt::Write as _;
|
||||
let mut body = String::new();
|
||||
for seg in segments {
|
||||
let s = seg
|
||||
@@ -1161,6 +1168,12 @@ fn run(cmd: &mut Command, label: &str) -> Result<()> {
|
||||
/// `progress_tx`, if provided, receives (pass, `total_passes`, percent) updates
|
||||
/// driven by ffmpeg's stable key=value output (`out_time_us`) rather than
|
||||
/// fragile stderr line parsing.
|
||||
// Thin forwarder to run_impl, which needs the same list; a params struct here
|
||||
// would just be reconstructed at each of the four call sites.
|
||||
#[allow(
|
||||
clippy::too_many_arguments,
|
||||
reason = "thin forwarder for the ffmpeg invocation; callers already hold these as locals"
|
||||
)]
|
||||
fn run_with_progress(
|
||||
cmd: &mut Command,
|
||||
label: &str,
|
||||
@@ -1211,10 +1224,15 @@ fn ffmpeg_failure_message(label: &str, status: std::process::ExitStatus, stderr:
|
||||
|
||||
// Consumes the progress sender and the cancel flag: both are moved into the
|
||||
// reader threads this spawns, so borrowing them here would not typecheck.
|
||||
// The argument count matches run_with_progress, its only caller.
|
||||
#[allow(
|
||||
clippy::needless_pass_by_value,
|
||||
reason = "progress_tx and cancel are moved into the threads spawned below"
|
||||
)]
|
||||
#[allow(
|
||||
clippy::too_many_arguments,
|
||||
reason = "receives the ffmpeg invocation plus its progress plumbing from run_with_progress"
|
||||
)]
|
||||
fn run_impl(
|
||||
cmd: &mut Command,
|
||||
label: &str,
|
||||
|
||||
Reference in New Issue
Block a user