From e0e314ea7b65abb9a55bbc613a8acbd4fdc621e3 Mon Sep 17 00:00:00 2001 From: yangnianbing Date: Sun, 14 Jan 2024 16:37:21 +0800 Subject: [PATCH 1/3] feat: custom message field --- src/stash.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/stash.rs b/src/stash.rs index ea898e46ba..da2f3936c8 100644 --- a/src/stash.rs +++ b/src/stash.rs @@ -37,7 +37,13 @@ impl<'a> StashSaveOptions<'a> { ); opts } - + /// Customize optional `message` field + pub fn message(&mut self, message: Option<&str>) -> &mut Self { + let message = crate::opt_cstr(message).unwrap_or_default(); + self.message = message; + self + } + /// Customize optional `flags` field pub fn flags(&mut self, flags: Option) -> &mut Self { self.flags = flags; From e3706a2854198bc73494deb041576482204dad54 Mon Sep 17 00:00:00 2001 From: microbingbing <137602812@qq.com> Date: Thu, 29 Feb 2024 22:35:38 +0800 Subject: [PATCH 2/3] Update stash.rs --- src/stash.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stash.rs b/src/stash.rs index da2f3936c8..44ff0c35a0 100644 --- a/src/stash.rs +++ b/src/stash.rs @@ -37,6 +37,7 @@ impl<'a> StashSaveOptions<'a> { ); opts } + /// Customize optional `message` field pub fn message(&mut self, message: Option<&str>) -> &mut Self { let message = crate::opt_cstr(message).unwrap_or_default(); From 050e415fae95d2a4fa4d9f93972390ec4eb63193 Mon Sep 17 00:00:00 2001 From: microbingbing <137602812@qq.com> Date: Thu, 29 Feb 2024 22:46:34 +0800 Subject: [PATCH 3/3] Update stash.rs --- src/stash.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stash.rs b/src/stash.rs index 44ff0c35a0..acf6e44036 100644 --- a/src/stash.rs +++ b/src/stash.rs @@ -37,14 +37,14 @@ impl<'a> StashSaveOptions<'a> { ); opts } - + /// Customize optional `message` field pub fn message(&mut self, message: Option<&str>) -> &mut Self { let message = crate::opt_cstr(message).unwrap_or_default(); self.message = message; self } - + /// Customize optional `flags` field pub fn flags(&mut self, flags: Option) -> &mut Self { self.flags = flags;