Skip to content

Commit 69426d1

Browse files
authored
Merge pull request #81 from kinode-dao/hf/mut-on-exit
on_exit: use mut ref
2 parents 847188a + 2cf3446 commit 69426d1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "kinode_process_lib"
33
description = "A library for writing Kinode processes in Rust."
4-
version = "0.8.0"
4+
version = "0.8.2"
55
edition = "2021"
66
license-file = "LICENSE"
77
homepage = "https://kinode.org"

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)