Skip to content

Commit 43afdf4

Browse files
committed
on_exit: use mut ref
1 parent 847188a commit 43afdf4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/types/on_exit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ impl OnExit {
6464
}
6565
}
6666
/// Add a request to this OnExit if it is Requests, fail otherwise
67-
pub fn add_request(self, new: Request) -> anyhow::Result<()> {
67+
pub fn add_request(&mut self, new: Request) -> anyhow::Result<()> {
6868
match self {
6969
OnExit::None => Err(anyhow::anyhow!("cannot add request to None")),
7070
OnExit::Restart => Err(anyhow::anyhow!("cannot add request to Restart")),
71-
OnExit::Requests(mut reqs) => {
71+
OnExit::Requests(ref mut reqs) => {
7272
reqs.push(new);
7373
Ok(())
7474
}

0 commit comments

Comments
 (0)