Fix clippy lints (#68)

* Specify type params in transmute calls

* Replace legacy numeric methods with constants
This commit is contained in:
FreezyLemon 2024-06-14 17:44:38 +02:00 committed by GitHub
parent 0ad8ef0c66
commit ab0c7549b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 6 deletions

View File

@ -122,9 +122,9 @@ impl Input {
match avformat_seek_file(
self.as_mut_ptr(),
-1,
range.start().cloned().unwrap_or(i64::min_value()),
range.start().cloned().unwrap_or(i64::MIN),
ts,
range.end().cloned().unwrap_or(i64::max_value()),
range.end().cloned().unwrap_or(i64::MAX),
0,
) {
s if s >= 0 => Ok(()),

View File

@ -63,7 +63,9 @@ impl Audio {
if (*self.as_ptr()).format == -1 {
format::Sample::None
} else {
format::Sample::from(mem::transmute::<_, AVSampleFormat>((*self.as_ptr()).format))
format::Sample::from(mem::transmute::<c_int, AVSampleFormat>(
(*self.as_ptr()).format,
))
}
}
}

View File

@ -52,7 +52,9 @@ impl Video {
if (*self.as_ptr()).format == -1 {
format::Pixel::None
} else {
format::Pixel::from(mem::transmute::<_, AVPixelFormat>((*self.as_ptr()).format))
format::Pixel::from(mem::transmute::<c_int, AVPixelFormat>(
(*self.as_ptr()).format,
))
}
}
}

View File

@ -26,7 +26,7 @@ impl Rational {
#[inline]
pub fn reduce(&self) -> Rational {
match self.reduce_with_limit(i32::max_value()) {
match self.reduce_with_limit(i32::MAX) {
Ok(r) => r,
Err(r) => r,
}
@ -80,7 +80,7 @@ impl From<Rational> for AVRational {
impl From<f64> for Rational {
#[inline]
fn from(value: f64) -> Rational {
unsafe { Rational::from(av_d2q(value, c_int::max_value())) }
unsafe { Rational::from(av_d2q(value, c_int::MAX)) }
}
}