Browse Source

Fixed an overlapping text issue with cirno.fumo

main
Unbewohnte 3 years ago
parent
commit
96c2b70897
  1. 2
      Cargo.lock
  2. 3
      fumofiles/cirno.fumo
  3. 2
      src/main.rs

2
Cargo.lock generated

@ -45,7 +45,7 @@ dependencies = [
[[package]] [[package]]
name = "fumosay" name = "fumosay"
version = "0.4.1" version = "0.4.2"
dependencies = [ dependencies = [
"clap", "clap",
] ]

3
fumofiles/cirno.fumo

@ -1,4 +1,5 @@
__ __ <!message> <!message>
__ __ ()
| \ / | () | \ / | ()
| \____/ | () | \____/ | ()
|__// V \\__| |__// V \\__|

2
src/main.rs

@ -14,7 +14,7 @@ const DEFAULT_FUMOFILES_DIR: &str = "/usr/local/share/fumosay/fumofiles/";
/// `message` will be added on the new line at the end of the fumofile. /// `message` will be added on the new line at the end of the fumofile.
fn process_message(fumofile_contents: &mut String, message: &str) -> String { fn process_message(fumofile_contents: &mut String, message: &str) -> String {
if fumofile_contents.contains(MESSAGE_INDICATOR) { if fumofile_contents.contains(MESSAGE_INDICATOR) {
return fumofile_contents.replace(MESSAGE_INDICATOR,message); return fumofile_contents.replace(MESSAGE_INDICATOR, message);
} }
return format!("{}\n{}", fumofile_contents, message); return format!("{}\n{}", fumofile_contents, message);
} }

Loading…
Cancel
Save