Fix clippy warnings (#639)

This commit is contained in:
redzic 2022-06-20 14:53:07 -05:00 committed by GitHub
parent 22281844bb
commit dfdc2c6703
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 11 deletions

View file

@ -20,7 +20,7 @@ const NULL: &str = if cfg!(windows) { "nul" } else { "/dev/null" };
#[allow(non_camel_case_types)]
#[derive(
Clone, Copy, PartialEq, Serialize, Deserialize, Debug, strum::EnumString, strum::IntoStaticStr,
Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Debug, strum::EnumString, strum::IntoStaticStr,
)]
pub enum Encoder {
aom,

View file

@ -16,6 +16,7 @@
#![allow(clippy::drop_ref)]
#![allow(clippy::unsafe_derive_deserialize)]
#![allow(clippy::needless_pass_by_value)]
#![allow(clippy::use_self)]
#[macro_use]
extern crate log;
@ -364,7 +365,7 @@ fn save_chunk_queue(temp: &str, chunk_queue: &[Chunk]) -> anyhow::Result<()> {
Ok(())
}
#[derive(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Verbosity {
Verbose,
Normal,

View file

@ -1347,10 +1347,7 @@ properly into a mkv file. Specify mkvmerge as the concatenation method by settin
self.vmaf_path.as_deref(),
self.vmaf_res.as_str(),
1,
match self.vmaf_filter.as_deref() {
Some(filter) => Some(filter),
None => None,
},
self.vmaf_filter.as_deref(),
self.vmaf_threads.unwrap_or_else(|| {
available_parallelism()
.expect("Unrecoverable: Failed to get thread count")

View file

@ -6,9 +6,9 @@ use std::path::{Path, PathBuf};
#[macro_export]
macro_rules! count {
() => (0_usize);
($x:tt, $($xs:tt),*) => (1_usize + crate::count!($($xs)*));
($x:tt, $($xs:tt)*) => (1_usize + crate::count!($($xs)*));
($x:tt $($xs:tt)*) => (1_usize + crate::count!($($xs)*));
($x:tt, $($xs:tt),*) => (1_usize + $crate::count!($($xs)*));
($x:tt, $($xs:tt)*) => (1_usize + $crate::count!($($xs)*));
($x:tt $($xs:tt)*) => (1_usize + $crate::count!($($xs)*));
}
/// Equivalent to `into_vec!` when the inferred type is `Cow<'_, str>`.
@ -26,7 +26,7 @@ macro_rules! inplace_vec {
use std::mem::{self, MaybeUninit};
use std::borrow::Cow;
const SIZE: usize = crate::count!($($x)*);
const SIZE: usize = $crate::count!($($x)*);
#[allow(unused_assignments)]
#[allow(clippy::transmute_undefined_repr)]
unsafe {

View file

@ -203,7 +203,7 @@ pub fn run_vmaf(
)
};
let mut source_pipe = if let [cmd, args @ ..] = &*reference_pipe_cmd {
let mut source_pipe = if let [cmd, args @ ..] = reference_pipe_cmd {
let mut source_pipe = Command::new(cmd);
source_pipe.args(args);
source_pipe.stdout(Stdio::piped());