From f670375fd0aa71dbee0a82333cc5f14d23e784fd Mon Sep 17 00:00:00 2001 From: Sebastian Urban Date: Fri, 6 Dec 2024 00:03:32 +0000 Subject: [PATCH] Fix clippy warnings --- .vscode/settings.json | 3 ++- src/function/custom/mod.rs | 12 ++++++------ src/function/util.rs | 2 +- src/function/video.rs | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e8fcb36..512f274 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { - "rust-analyzer.showUnlinkedFileNotification": false, "files.exclude": { "target/": true, }, @@ -33,4 +32,6 @@ } ], "rust-analyzer.cargo.features": "all", + "rust-analyzer.check.command": "clippy", + "rust-analyzer.showUnlinkedFileNotification": false, } \ No newline at end of file diff --git a/src/function/custom/mod.rs b/src/function/custom/mod.rs index 31808ba..7b7d829 100644 --- a/src/function/custom/mod.rs +++ b/src/function/custom/mod.rs @@ -1130,13 +1130,13 @@ pub struct CtrlSender<'a> { custom: &'a mut Custom, } -impl<'a> fmt::Debug for CtrlSender<'a> { +impl fmt::Debug for CtrlSender<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("CtrlSender").field("ctrl_req", &self.ctrl_req).finish() } } -impl<'a> CtrlSender<'a> { +impl CtrlSender<'_> { /// The control request. pub const fn ctrl_req(&self) -> &CtrlReq { &self.ctrl_req @@ -1180,7 +1180,7 @@ impl<'a> CtrlSender<'a> { } } -impl<'a> Drop for CtrlSender<'a> { +impl Drop for CtrlSender<'_> { fn drop(&mut self) { if self.custom.setup_event.is_some() { let _ = self.do_halt(); @@ -1196,13 +1196,13 @@ pub struct CtrlReceiver<'a> { custom: &'a mut Custom, } -impl<'a> fmt::Debug for CtrlReceiver<'a> { +impl fmt::Debug for CtrlReceiver<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("CtrlReceiver").field("ctrl_req", &self.ctrl_req).finish() } } -impl<'a> CtrlReceiver<'a> { +impl CtrlReceiver<'_> { /// The control request. pub const fn ctrl_req(&self) -> &CtrlReq { &self.ctrl_req @@ -1253,7 +1253,7 @@ impl<'a> CtrlReceiver<'a> { } } -impl<'a> Drop for CtrlReceiver<'a> { +impl Drop for CtrlReceiver<'_> { fn drop(&mut self) { if self.custom.setup_event.is_some() { let _ = self.do_halt(); diff --git a/src/function/util.rs b/src/function/util.rs index 3683732..78e9073 100644 --- a/src/function/util.rs +++ b/src/function/util.rs @@ -208,7 +208,7 @@ impl FunctionDir { /// Create a subdirectory and its parent directories. pub fn create_dir_all(&self, name: impl AsRef) -> Result<()> { let path = self.property_path(name)?; - log::debug!("creating directorys {}", path.display()); + log::debug!("creating directories {}", path.display()); fs::create_dir_all(path) } diff --git a/src/function/video.rs b/src/function/video.rs index 4633979..f2e1efe 100644 --- a/src/function/video.rs +++ b/src/function/video.rs @@ -180,7 +180,7 @@ impl UvcFrame { } fn path(&self) -> PathBuf { - self.format.group_path().join(&self.dir_name()) + self.format.group_path().join(self.dir_name()) } /// Create a new UVC frame with the specified properties.