Skip to content

Commit

Permalink
Fix some new clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyr committed Jun 7, 2021
1 parent 81f398d commit 2da0e35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions piet-direct2d/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,7 @@ fn draw_image<'a>(
InterpolationMode::NearestNeighbor => D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
InterpolationMode::Bilinear => D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
};
let src_rect = match src_rect {
Some(src_rect) => Some(rect_to_rectf(src_rect)),
None => None,
};
let src_rect = src_rect.map(rect_to_rectf);
rt.draw_bitmap(
&image,
&rect_to_rectf(dst_rect),
Expand Down
2 changes: 1 addition & 1 deletion piet/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ impl ImageBuf {
assert_eq!(pixels.len(), width * height * format.bytes_per_pixel());
ImageBuf {
pixels,
format,
width,
height,
format,
}
}

Expand Down
2 changes: 1 addition & 1 deletion piet/src/samples/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ pub fn samples_main(

impl<T> SamplePicture<T> {
fn new(size: Size, draw_f: fn(&mut T) -> Result<(), Error>) -> Self {
SamplePicture { size, draw_f }
SamplePicture { draw_f, size }
}

/// The size of the context expected by this sample, in pixels.
Expand Down

0 comments on commit 2da0e35

Please sign in to comment.