Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
l1npengtul committed Dec 19, 2022
1 parent f687649 commit a6c0b60
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions nokhwa-core/src/pixel_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub trait FormatDecoder: Clone + Sized + Send + Sync {
/// Allocates and returns a `Vec`
/// # Errors
/// If the data is malformed, or the source [`FrameFormat`] is incompatible, this will error.
#[inline]
fn write_output(
fcc: FrameFormat,
resolution: Resolution,
Expand All @@ -39,7 +38,6 @@ pub trait FormatDecoder: Clone + Sized + Send + Sync {
/// Writes to a user provided buffer.
/// # Errors
/// If the data is malformed, the source [`FrameFormat`] is incompatible, or the user-alloted buffer is not large enough, this will error.
#[inline]
fn write_output_buffer(
fcc: FrameFormat,
resolution: Resolution,
Expand All @@ -61,6 +59,7 @@ impl FormatDecoder for RgbFormat {
type Output = Rgb<u8>;
const FORMATS: &'static [FrameFormat] = color_frame_formats();

#[inline]
fn write_output(
fcc: FrameFormat,
resolution: Resolution,
Expand All @@ -81,6 +80,7 @@ impl FormatDecoder for RgbFormat {
}
}

#[inline]
fn write_output_buffer(
fcc: FrameFormat,
resolution: Resolution,
Expand Down Expand Up @@ -130,6 +130,7 @@ impl FormatDecoder for RgbAFormat {

const FORMATS: &'static [FrameFormat] = color_frame_formats();

#[inline]
fn write_output(
fcc: FrameFormat,
resolution: Resolution,
Expand All @@ -153,6 +154,7 @@ impl FormatDecoder for RgbAFormat {
}
}

#[inline]
fn write_output_buffer(
fcc: FrameFormat,
resolution: Resolution,
Expand Down Expand Up @@ -212,6 +214,7 @@ impl FormatDecoder for LumaFormat {

#[allow(clippy::cast_possible_truncation)]
#[allow(clippy::cast_sign_loss)]
#[inline]
fn write_output(
fcc: FrameFormat,
resolution: Resolution,
Expand Down Expand Up @@ -253,6 +256,7 @@ impl FormatDecoder for LumaFormat {
}
}

#[inline]
fn write_output_buffer(
fcc: FrameFormat,
_resolution: Resolution,
Expand Down Expand Up @@ -297,7 +301,9 @@ impl FormatDecoder for LumaAFormat {
type Output = LumaA<u8>;

const FORMATS: &'static [FrameFormat] = frame_formats();

#[allow(clippy::cast_possible_truncation)]
#[inline]
fn write_output(
fcc: FrameFormat,
resolution: Resolution,
Expand Down Expand Up @@ -340,6 +346,7 @@ impl FormatDecoder for LumaAFormat {
}
}

#[inline]
fn write_output_buffer(
fcc: FrameFormat,
_resolution: Resolution,
Expand Down

0 comments on commit a6c0b60

Please sign in to comment.