Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy issues and stop it from breaking with every Rust update #929

Merged
merged 1 commit into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions av1an-core/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,14 +733,13 @@ impl Av1anContext {
let zones = self.parse_zones()?;

// Create a new input with the generated VapourSynth script for Scene Detection
let input = if let Some(ref vs_script) = self.vs_script {
Input::VapourSynth {
let input = self.vs_script.as_ref().map_or_else(
|| self.args.input.clone(),
|vs_script| Input::VapourSynth {
path: vs_script.clone(),
vspipe_args: Vec::new(),
}
} else {
self.args.input.clone()
};
},
);

Ok(match self.args.split_method {
SplitMethod::AvScenechange => av_scenechange_detect(
Expand Down
1 change: 1 addition & 0 deletions av1an-core/src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@ impl Encoder {
}
}

#[allow(clippy::too_many_arguments)]
/// Constructs tuple of commands for target quality probing
pub fn probe_cmd(
self,
Expand Down
24 changes: 1 addition & 23 deletions av1an-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
#![warn(clippy::all, clippy::pedantic, clippy::nursery)]
#![allow(clippy::missing_errors_doc)]
#![allow(clippy::missing_panics_doc)]
#![allow(clippy::cast_possible_truncation)]
#![allow(clippy::cast_sign_loss)]
#![allow(clippy::cast_precision_loss)]
#![allow(clippy::must_use_candidate)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::too_many_lines)]
#![allow(clippy::cast_possible_wrap)]
#![allow(clippy::if_not_else)]
#![allow(clippy::module_name_repetitions)]
#![allow(clippy::doc_markdown)]
#![allow(clippy::items_after_statements)]
#![allow(clippy::wildcard_imports)]
#![allow(clippy::unsafe_derive_deserialize)]
#![allow(clippy::needless_pass_by_value)]
#![allow(clippy::use_self)]

#[macro_use]
extern crate log;

Expand Down Expand Up @@ -123,10 +104,7 @@ impl Input {
ffmpeg::num_frames(path.as_path()).map_err(|_| anyhow::anyhow!(FAIL_MSG))?
}
path => vapoursynth::num_frames(
vs_script_path
.as_ref()
.map(|p| p.as_path())
.unwrap_or(path.as_path()),
vs_script_path.as_deref().unwrap_or(path.as_path()),
self.as_vspipe_args_map()?,
)
.map_err(|_| anyhow::anyhow!(FAIL_MSG))?,
Expand Down
3 changes: 2 additions & 1 deletion av1an-core/src/scene_detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crate::scenes::Scene;
use crate::{into_smallvec, progress_bar, Encoder, Input, ScenecutMethod, Verbosity};

#[tracing::instrument]
#[allow(clippy::too_many_arguments)]
pub fn av_scenechange_detect(
input: &Input,
encoder: Encoder,
Expand Down Expand Up @@ -73,7 +74,7 @@ pub fn av_scenechange_detect(
}

/// Detect scene changes using rav1e scene detector.
#[allow(clippy::option_if_let_else)]
#[allow(clippy::too_many_arguments)]
pub fn scene_detect(
input: &Input,
encoder: Encoder,
Expand Down
2 changes: 2 additions & 0 deletions av1an-core/src/vmaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ pub fn validate_libvmaf() -> anyhow::Result<()> {
Ok(())
}

#[allow(clippy::too_many_arguments)]
pub fn plot(
encoded: &Path,
reference: &Input,
Expand Down Expand Up @@ -174,6 +175,7 @@ pub fn plot(
Ok(())
}

#[allow(clippy::too_many_arguments)]
pub fn run_vmaf(
encoded: &Path,
reference_pipe_cmd: &[impl AsRef<OsStr>],
Expand Down