Skip to content

Commit 104ecdb

Browse files
Fix typo: AdvancedRemove -> AdvancedRemote (#14)
Also, fix clippy warnings. --------- Co-authored-by: foxx <james.k@konnektive.com>
1 parent f729243 commit 104ecdb

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

behavioral/chain-of-responsibility/department.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ pub trait Department {
2828
}
2929

3030
/// Helps to wrap an object into a boxed type.
31-
pub(self) fn into_next(
32-
department: impl Department + Sized + 'static,
33-
) -> Option<Box<dyn Department>> {
31+
pub fn into_next(department: impl Department + Sized + 'static) -> Option<Box<dyn Department>> {
3432
Some(Box::new(department))
3533
}

behavioral/command/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn main() {
2323
app.add_layer(
2424
Dialog::around(EditView::default().with_name("Editor"))
2525
.title("Type and use buttons")
26-
.button("Copy", |s| execute(s, CopyCommand::default()))
26+
.button("Copy", |s| execute(s, CopyCommand))
2727
.button("Cut", |s| execute(s, CutCommand::default()))
2828
.button("Paste", |s| execute(s, PasteCommand::default()))
2929
.button("Undo", undo)

structural/bridge/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mod device;
22
mod remotes;
33

44
use device::{Device, Radio, Tv};
5-
use remotes::{AdvancedRemove, BasicRemote, HasMutableDevice, Remote};
5+
use remotes::{AdvancedRemote, BasicRemote, HasMutableDevice, Remote};
66

77
fn main() {
88
test_device(Tv::default());
@@ -16,7 +16,7 @@ fn test_device(device: impl Device + Clone) {
1616
basic_remote.device().print_status();
1717

1818
println!("Tests with advanced remote.");
19-
let mut advanced_remote = AdvancedRemove::new(device);
19+
let mut advanced_remote = AdvancedRemote::new(device);
2020
advanced_remote.power();
2121
advanced_remote.mute();
2222
advanced_remote.device().print_status();

structural/bridge/remotes/advanced.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use crate::device::Device;
22

33
use super::{HasMutableDevice, Remote};
44

5-
pub struct AdvancedRemove<D: Device> {
5+
pub struct AdvancedRemote<D: Device> {
66
device: D,
77
}
88

9-
impl<D: Device> AdvancedRemove<D> {
9+
impl<D: Device> AdvancedRemote<D> {
1010
pub fn new(device: D) -> Self {
1111
Self { device }
1212
}
@@ -17,10 +17,10 @@ impl<D: Device> AdvancedRemove<D> {
1717
}
1818
}
1919

20-
impl<D: Device> HasMutableDevice<D> for AdvancedRemove<D> {
20+
impl<D: Device> HasMutableDevice<D> for AdvancedRemote<D> {
2121
fn device(&mut self) -> &mut D {
2222
&mut self.device
2323
}
2424
}
2525

26-
impl<D: Device> Remote<D> for AdvancedRemove<D> {}
26+
impl<D: Device> Remote<D> for AdvancedRemote<D> {}

structural/bridge/remotes/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
mod advanced;
22
mod basic;
33

4-
pub use advanced::AdvancedRemove;
4+
pub use advanced::AdvancedRemote;
55
pub use basic::BasicRemote;
66

77
use crate::device::Device;

0 commit comments

Comments
 (0)