Skip to content

Commit

Permalink
on_exit: use mut ref
Browse files Browse the repository at this point in the history
  • Loading branch information
nick1udwig committed Jun 12, 2024
1 parent 847188a commit 43afdf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types/on_exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ impl OnExit {
}
}
/// Add a request to this OnExit if it is Requests, fail otherwise
pub fn add_request(self, new: Request) -> anyhow::Result<()> {
pub fn add_request(&mut self, new: Request) -> anyhow::Result<()> {
match self {
OnExit::None => Err(anyhow::anyhow!("cannot add request to None")),
OnExit::Restart => Err(anyhow::anyhow!("cannot add request to Restart")),
OnExit::Requests(mut reqs) => {
OnExit::Requests(ref mut reqs) => {
reqs.push(new);
Ok(())
}
Expand Down

0 comments on commit 43afdf4

Please sign in to comment.