Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
philn committed Mar 22, 2024
1 parent 76cf6e9 commit 68c1efb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dav1d-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ mod build {
runner!("meson", "install", "-C", build_path.to_str().unwrap());

let pkg_dir = build_path.join("meson-private");
system_deps::Library::from_internal_pkg_config(&pkg_dir, lib, TAG)
system_deps::Library::from_internal_pkg_config(pkg_dir, lib, TAG)
}
}

Expand Down
19 changes: 7 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::fmt;
use std::i64;
use std::mem;
use std::ptr;
use std::sync::Arc;
use std::rc::Rc;

/// Error enum return by various `dav1d` operations.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
Expand Down Expand Up @@ -189,20 +189,15 @@ bitflags::bitflags! {
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub enum DecodeFrameType {
#[default]
All,
Reference,
Intra,
Key,
}

impl Default for DecodeFrameType {
fn default() -> Self {
DecodeFrameType::All
}
}

impl TryFrom<u32> for DecodeFrameType {
type Error = TryFromEnumError;

Expand Down Expand Up @@ -418,7 +413,7 @@ impl Decoder {
} else {
let inner = InnerPicture { pic };
Ok(Picture {
inner: Arc::new(inner),
inner: Rc::new(inner),
})
}
}
Expand Down Expand Up @@ -453,7 +448,7 @@ struct InnerPicture {
/// A decoded frame.
#[derive(Debug, Clone)]
pub struct Picture {
inner: Arc<InnerPicture>,
inner: Rc<InnerPicture>,
}

/// Pixel layout of a frame.
Expand Down Expand Up @@ -561,7 +556,7 @@ impl Picture {
PixelLayout::I400 | PixelLayout::I422 | PixelLayout::I444 => self.height(),
},
};
(self.stride(component) as u32, height)
(self.stride(component), height)
}

/// Plane data of the `component` for the decoded frame.
Expand Down Expand Up @@ -631,7 +626,7 @@ impl Picture {
/// This is the same duration as the one provided to [`Decoder::send_data`] or `0` if none was
/// provided.
pub fn duration(&self) -> i64 {
self.inner.pic.m.duration as i64
self.inner.pic.m.duration
}

/// Offset of the frame.
Expand Down

0 comments on commit 68c1efb

Please sign in to comment.