Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo - AdvancedRemove -> AdvancedRemote #14

Merged
merged 5 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading