From e7de1dddd9d746ffff57193ec35173305fa49ec8 Mon Sep 17 00:00:00 2001 From: Michel Pastor Date: Sun, 6 Aug 2023 22:45:23 +0100 Subject: [PATCH] apply clippy suggestions --- appimage_builder/src/main.rs | 2 +- src/osd/dji/file.rs | 2 +- src/osd/overlay.rs | 2 +- src/osd/overlay/scaling.rs | 6 +----- src/osd/wsa/file.rs | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/appimage_builder/src/main.rs b/appimage_builder/src/main.rs index 8cce280..e170e7c 100644 --- a/appimage_builder/src/main.rs +++ b/appimage_builder/src/main.rs @@ -220,7 +220,7 @@ fn main() -> anyhow::Result<()> { } let appimage_path = Path::new(application_name).with_extension("AppImage"); - generate_appimage(&appimage_path, &appdir_path)?; + generate_appimage(appimage_path, &appdir_path)?; Ok(()) } \ No newline at end of file diff --git a/src/osd/dji/file.rs b/src/osd/dji/file.rs index e732e4a..0984df9 100644 --- a/src/osd/dji/file.rs +++ b/src/osd/dji/file.rs @@ -219,7 +219,7 @@ impl Reader { fn keep_position_do(&mut self, f: F) -> Result where F: FnOnce(&mut Self) -> Result { - let starting_position = self.file.seek(SeekFrom::Current(0)).unwrap(); + let starting_position = self.file.stream_position().unwrap(); let return_value = f(self); self.file.seek(SeekFrom::Start(starting_position)).unwrap(); return_value diff --git a/src/osd/overlay.rs b/src/osd/overlay.rs index c8b8d6a..5b859be 100644 --- a/src/osd/overlay.rs +++ b/src/osd/overlay.rs @@ -102,7 +102,7 @@ impl super::file::Frame { let y = osd_coordinates.y as u32 * tiles_height; if x < frame.width() && y < frame.height() { frame.copy_from( - &tile_image, + tile_image, osd_coordinates.x as u32 * tiles_width, osd_coordinates.y as u32 * tiles_height ).unwrap(); diff --git a/src/osd/overlay/scaling.rs b/src/osd/overlay/scaling.rs index 0fdedc0..0bb0326 100644 --- a/src/osd/overlay/scaling.rs +++ b/src/osd/overlay/scaling.rs @@ -6,11 +6,7 @@ use derive_more::From; use getset::{CopyGetters, Getters}; use thiserror::Error; -use super::{ - margins::{ - Margins, - }, -}; +use super::margins::Margins; use crate::video::{ resolution::{ diff --git a/src/osd/wsa/file.rs b/src/osd/wsa/file.rs index 8e71e2f..558f8de 100644 --- a/src/osd/wsa/file.rs +++ b/src/osd/wsa/file.rs @@ -147,7 +147,7 @@ impl Reader { fn keep_position_do(&mut self, f: F) -> Result where F: FnOnce(&mut Self) -> Result { - let starting_position = self.file.seek(SeekFrom::Current(0)).unwrap(); + let starting_position = self.file.stream_position().unwrap(); let return_value = f(self); self.file.seek(SeekFrom::Start(starting_position)).unwrap(); return_value