From 34b16cb5d4d98c83c3a66280d712659905782816 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 4 Jan 2022 18:17:46 +0100 Subject: [PATCH] separate file for error message function --- src/erreur.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/erreur.rs diff --git a/src/erreur.rs b/src/erreur.rs new file mode 100644 index 0000000..c7023e9 --- /dev/null +++ b/src/erreur.rs @@ -0,0 +1,8 @@ +/// Jolie message d'erreur +pub fn message_erreur(message: &str) -> String { + format!( + "\n{sep}\n{msg}\n{sep}\n", + sep = "=".repeat(message.len()), + msg = message + ) +}