From 104ecdbc48d52eeab737ec02ef2443b20b66cd90 Mon Sep 17 00:00:00 2001 From: Koonts <37273704+helloimalemur@users.noreply.github.com> Date: Fri, 24 Nov 2023 13:20:31 -0500 Subject: [PATCH] Fix typo: AdvancedRemove -> AdvancedRemote (#14) Also, fix clippy warnings. --------- Co-authored-by: foxx --- behavioral/chain-of-responsibility/department.rs | 4 +--- behavioral/command/main.rs | 2 +- structural/bridge/main.rs | 4 ++-- structural/bridge/remotes/advanced.rs | 8 ++++---- structural/bridge/remotes/mod.rs | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/behavioral/chain-of-responsibility/department.rs b/behavioral/chain-of-responsibility/department.rs index 86b624a..8e9d1c5 100644 --- a/behavioral/chain-of-responsibility/department.rs +++ b/behavioral/chain-of-responsibility/department.rs @@ -28,8 +28,6 @@ pub trait Department { } /// Helps to wrap an object into a boxed type. -pub(self) fn into_next( - department: impl Department + Sized + 'static, -) -> Option> { +pub fn into_next(department: impl Department + Sized + 'static) -> Option> { Some(Box::new(department)) } diff --git a/behavioral/command/main.rs b/behavioral/command/main.rs index 94bb9c1..66bb220 100644 --- a/behavioral/command/main.rs +++ b/behavioral/command/main.rs @@ -23,7 +23,7 @@ fn main() { app.add_layer( Dialog::around(EditView::default().with_name("Editor")) .title("Type and use buttons") - .button("Copy", |s| execute(s, CopyCommand::default())) + .button("Copy", |s| execute(s, CopyCommand)) .button("Cut", |s| execute(s, CutCommand::default())) .button("Paste", |s| execute(s, PasteCommand::default())) .button("Undo", undo) diff --git a/structural/bridge/main.rs b/structural/bridge/main.rs index fad5a76..ff6cf61 100644 --- a/structural/bridge/main.rs +++ b/structural/bridge/main.rs @@ -2,7 +2,7 @@ mod device; mod remotes; use device::{Device, Radio, Tv}; -use remotes::{AdvancedRemove, BasicRemote, HasMutableDevice, Remote}; +use remotes::{AdvancedRemote, BasicRemote, HasMutableDevice, Remote}; fn main() { test_device(Tv::default()); @@ -16,7 +16,7 @@ fn test_device(device: impl Device + Clone) { basic_remote.device().print_status(); println!("Tests with advanced remote."); - let mut advanced_remote = AdvancedRemove::new(device); + let mut advanced_remote = AdvancedRemote::new(device); advanced_remote.power(); advanced_remote.mute(); advanced_remote.device().print_status(); diff --git a/structural/bridge/remotes/advanced.rs b/structural/bridge/remotes/advanced.rs index 37f1505..f138456 100644 --- a/structural/bridge/remotes/advanced.rs +++ b/structural/bridge/remotes/advanced.rs @@ -2,11 +2,11 @@ use crate::device::Device; use super::{HasMutableDevice, Remote}; -pub struct AdvancedRemove { +pub struct AdvancedRemote { device: D, } -impl AdvancedRemove { +impl AdvancedRemote { pub fn new(device: D) -> Self { Self { device } } @@ -17,10 +17,10 @@ impl AdvancedRemove { } } -impl HasMutableDevice for AdvancedRemove { +impl HasMutableDevice for AdvancedRemote { fn device(&mut self) -> &mut D { &mut self.device } } -impl Remote for AdvancedRemove {} +impl Remote for AdvancedRemote {} diff --git a/structural/bridge/remotes/mod.rs b/structural/bridge/remotes/mod.rs index 08c997e..7148c53 100644 --- a/structural/bridge/remotes/mod.rs +++ b/structural/bridge/remotes/mod.rs @@ -1,7 +1,7 @@ mod advanced; mod basic; -pub use advanced::AdvancedRemove; +pub use advanced::AdvancedRemote; pub use basic::BasicRemote; use crate::device::Device;