Skip to content

Commit cf49a86

Browse files
Fix clippy lints (#201)
1 parent 0e4c39a commit cf49a86

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

src/format/context/input.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ impl Input {
126126
match avformat_seek_file(
127127
self.as_mut_ptr(),
128128
-1,
129-
range.start().cloned().unwrap_or(i64::min_value()),
129+
range.start().cloned().unwrap_or(i64::MIN),
130130
ts,
131-
range.end().cloned().unwrap_or(i64::max_value()),
131+
range.end().cloned().unwrap_or(i64::MAX),
132132
0,
133133
) {
134134
s if s >= 0 => Ok(()),

src/util/frame/audio.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ impl Audio {
4949
if (*self.as_ptr()).format == -1 {
5050
format::Sample::None
5151
} else {
52-
format::Sample::from(mem::transmute::<_, AVSampleFormat>((*self.as_ptr()).format))
52+
format::Sample::from(mem::transmute::<i32, AVSampleFormat>(
53+
(*self.as_ptr()).format,
54+
))
5355
}
5456
}
5557
}

src/util/frame/video.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ impl Video {
5252
if (*self.as_ptr()).format == -1 {
5353
format::Pixel::None
5454
} else {
55-
format::Pixel::from(mem::transmute::<_, AVPixelFormat>((*self.as_ptr()).format))
55+
format::Pixel::from(mem::transmute::<i32, AVPixelFormat>(
56+
(*self.as_ptr()).format,
57+
))
5658
}
5759
}
5860
}

src/util/rational.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl Rational {
2626

2727
#[inline]
2828
pub fn reduce(&self) -> Rational {
29-
match self.reduce_with_limit(i32::max_value()) {
29+
match self.reduce_with_limit(i32::MAX) {
3030
Ok(r) => r,
3131
Err(r) => r,
3232
}
@@ -80,7 +80,7 @@ impl From<Rational> for AVRational {
8080
impl From<f64> for Rational {
8181
#[inline]
8282
fn from(value: f64) -> Rational {
83-
unsafe { Rational::from(av_d2q(value, c_int::max_value())) }
83+
unsafe { Rational::from(av_d2q(value, c_int::MAX)) }
8484
}
8585
}
8686

0 commit comments

Comments
 (0)