Fix clippy lints (#68)
* Specify type params in transmute calls * Replace legacy numeric methods with constants
This commit is contained in:
parent
0ad8ef0c66
commit
ab0c7549b2
@ -122,9 +122,9 @@ impl Input {
|
|||||||
match avformat_seek_file(
|
match avformat_seek_file(
|
||||||
self.as_mut_ptr(),
|
self.as_mut_ptr(),
|
||||||
-1,
|
-1,
|
||||||
range.start().cloned().unwrap_or(i64::min_value()),
|
range.start().cloned().unwrap_or(i64::MIN),
|
||||||
ts,
|
ts,
|
||||||
range.end().cloned().unwrap_or(i64::max_value()),
|
range.end().cloned().unwrap_or(i64::MAX),
|
||||||
0,
|
0,
|
||||||
) {
|
) {
|
||||||
s if s >= 0 => Ok(()),
|
s if s >= 0 => Ok(()),
|
||||||
|
@ -63,7 +63,9 @@ impl Audio {
|
|||||||
if (*self.as_ptr()).format == -1 {
|
if (*self.as_ptr()).format == -1 {
|
||||||
format::Sample::None
|
format::Sample::None
|
||||||
} else {
|
} else {
|
||||||
format::Sample::from(mem::transmute::<_, AVSampleFormat>((*self.as_ptr()).format))
|
format::Sample::from(mem::transmute::<c_int, AVSampleFormat>(
|
||||||
|
(*self.as_ptr()).format,
|
||||||
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,9 @@ impl Video {
|
|||||||
if (*self.as_ptr()).format == -1 {
|
if (*self.as_ptr()).format == -1 {
|
||||||
format::Pixel::None
|
format::Pixel::None
|
||||||
} else {
|
} else {
|
||||||
format::Pixel::from(mem::transmute::<_, AVPixelFormat>((*self.as_ptr()).format))
|
format::Pixel::from(mem::transmute::<c_int, AVPixelFormat>(
|
||||||
|
(*self.as_ptr()).format,
|
||||||
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ impl Rational {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn reduce(&self) -> Rational {
|
pub fn reduce(&self) -> Rational {
|
||||||
match self.reduce_with_limit(i32::max_value()) {
|
match self.reduce_with_limit(i32::MAX) {
|
||||||
Ok(r) => r,
|
Ok(r) => r,
|
||||||
Err(r) => r,
|
Err(r) => r,
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ impl From<Rational> for AVRational {
|
|||||||
impl From<f64> for Rational {
|
impl From<f64> for Rational {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn from(value: f64) -> Rational {
|
fn from(value: f64) -> Rational {
|
||||||
unsafe { Rational::from(av_d2q(value, c_int::max_value())) }
|
unsafe { Rational::from(av_d2q(value, c_int::MAX)) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user