Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Finomnis committed Jan 7, 2023
1 parent 62cd316 commit d7a6183
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/hyper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async fn hyper_subsystem(subsys: SubsystemHandle) -> Result<()> {
server
.with_graceful_shutdown(subsys.on_shutdown_requested())
.await
.or_else(|err| Err(miette! {err}))
.map_err(|err| miette! {err})
}

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ mod tests {
};

let matches_related = |data: &Vec<SubsystemError<BoxedError>>| {
let mut iter = data.into_iter();
let mut iter = data.iter();

let elem = iter.next().unwrap();
assert_eq!(elem.name(), "a");
Expand Down
2 changes: 1 addition & 1 deletion tests/common/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub struct Event {
}

impl Event {
pub fn create() -> (Self, impl FnOnce() -> ()) {
pub fn create() -> (Self, impl FnOnce()) {
let (sender, receiver) = watch::channel(false);
(Self { receiver }, move || {
sender.send_replace(true);
Expand Down
8 changes: 4 additions & 4 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,12 +944,12 @@ async fn subsystem_errors_get_propagated_to_user() {
assert_eq!("subsys/nested2", name);
assert_eq!("MyGreatError", format!("{}", e));
} else {
assert!(false, "Incorrect error type!");
panic!("Incorrect error type!");
}
assert!(matches!(el, SubsystemError::Failed(_, _)));
assert_eq!("subsys/nested2", el.name());
} else {
assert!(false, "Incorrect return value!");
panic!("Incorrect return value!");
}
}

Expand Down Expand Up @@ -1003,7 +1003,7 @@ async fn subsystem_errors_get_propagated_to_user_when_timeout() {
assert_eq!("subsys/nested2", name);
assert_eq!("MyGreatError", format!("{}", e));
} else {
assert!(false, "Incorrect error type!");
panic!("Incorrect error type!");
}
assert!(matches!(el, SubsystemError::Failed(_, _)));
assert_eq!("subsys/nested2", el.name());
Expand All @@ -1012,7 +1012,7 @@ async fn subsystem_errors_get_propagated_to_user_when_timeout() {
assert!(matches!(el, SubsystemError::Cancelled(_)));
assert_eq!("subsys/nested3", el.name());
} else {
assert!(false, "Incorrect return value!");
panic!("Incorrect return value!");
}
}

Expand Down

0 comments on commit d7a6183

Please sign in to comment.