Unbewohnte
3 years ago
3 changed files with 40 additions and 11 deletions
@ -1,6 +1,5 @@
|
||||
__________ |
||||
( !message ) |
||||
---------- |
||||
(!message) |
||||
() |
||||
() |
||||
() |
||||
\(ᗜˬᗜ)/ |
@ -1,8 +1,14 @@
|
||||
/// Indicator of where the message should be in fumofile
|
||||
pub const MESSAGE_INDICATOR: &str = "!message"; |
||||
/// Fumofile name of the default fumo
|
||||
pub const FUMO_DEFAULT: &str = "fumo.fumo";
|
||||
|
||||
pub fn sayify(fumofile: &mut String, message: &str) -> String { |
||||
if fumofile.contains(MESSAGE_INDICATOR) { |
||||
return fumofile.replace(MESSAGE_INDICATOR,message); |
||||
/// Returns a resulting string with `MESSAGE_INDICATOR` replaced with given
|
||||
/// `message`. If `MESSAGE_INDICATOR` is not present in fumofile - the
|
||||
/// `message` will be added on the new line at the end of the fumofile.
|
||||
pub fn sayify(fumofile_contents: &mut String, message: &str) -> String { |
||||
if fumofile_contents.contains(MESSAGE_INDICATOR) { |
||||
return fumofile_contents.replace(MESSAGE_INDICATOR,message); |
||||
} |
||||
return format!("{}\n{}", fumofile, message); |
||||
return format!("{}\n{}", fumofile_contents, message); |
||||
} |
Loading…
Reference in new issue