From 43afdf42a8afd1dd52e423e4503d00d30032c380 Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Wed, 12 Jun 2024 14:57:47 -0700 Subject: [PATCH] on_exit: use mut ref --- src/types/on_exit.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/on_exit.rs b/src/types/on_exit.rs index 2cec248..5647f22 100644 --- a/src/types/on_exit.rs +++ b/src/types/on_exit.rs @@ -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(()) }