Skip to content

Commit

Permalink
Fix typo: AdvancedRemove -> AdvancedRemote (#14)
Browse files Browse the repository at this point in the history
Also, fix clippy warnings.

---------
Co-authored-by: foxx <[email protected]>
  • Loading branch information
helloimalemur authored Nov 24, 2023
1 parent f729243 commit 104ecdb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions behavioral/chain-of-responsibility/department.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<dyn Department>> {
pub fn into_next(department: impl Department + Sized + 'static) -> Option<Box<dyn Department>> {
Some(Box::new(department))
}
2 changes: 1 addition & 1 deletion behavioral/command/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions structural/bridge/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions structural/bridge/remotes/advanced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use crate::device::Device;

use super::{HasMutableDevice, Remote};

pub struct AdvancedRemove<D: Device> {
pub struct AdvancedRemote<D: Device> {
device: D,
}

impl<D: Device> AdvancedRemove<D> {
impl<D: Device> AdvancedRemote<D> {
pub fn new(device: D) -> Self {
Self { device }
}
Expand All @@ -17,10 +17,10 @@ impl<D: Device> AdvancedRemove<D> {
}
}

impl<D: Device> HasMutableDevice<D> for AdvancedRemove<D> {
impl<D: Device> HasMutableDevice<D> for AdvancedRemote<D> {
fn device(&mut self) -> &mut D {
&mut self.device
}
}

impl<D: Device> Remote<D> for AdvancedRemove<D> {}
impl<D: Device> Remote<D> for AdvancedRemote<D> {}
2 changes: 1 addition & 1 deletion structural/bridge/remotes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod advanced;
mod basic;

pub use advanced::AdvancedRemove;
pub use advanced::AdvancedRemote;
pub use basic::BasicRemote;

use crate::device::Device;
Expand Down

0 comments on commit 104ecdb

Please sign in to comment.