From 32304f4ea0d403871580883c11b45cf028abf459 Mon Sep 17 00:00:00 2001 From: Raptorox <70806316+Raptorox@users.noreply.github.com> Date: Tue, 28 Jul 2026 17:34:33 +0200 Subject: [PATCH] make say use Option --- src/command/say.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/command/say.rs b/src/command/say.rs index 471e694..6f92b75 100644 --- a/src/command/say.rs +++ b/src/command/say.rs @@ -1,16 +1,16 @@ #[derive(Default)] pub struct SayCommand { - message: String + message: Option } impl SayCommand { pub fn message(mut self, msg: impl Into) -> Self { - self.message = msg.into(); + self.message = Some(msg.into()); self } pub fn build(self) -> super::Command { - let message = self.message; + let message = self.message.unwrap_or("Hello, world!".to_string()); let s = format!("say {message}"); super::Command(s) }