From 18b42c11c3ff5b7ccdba842bd98443b8f2310e51 Mon Sep 17 00:00:00 2001 From: Augusto Date: Mon, 11 Oct 2021 10:54:02 +0100 Subject: [PATCH] Rust piscine: Remove unnecessary function in exercise profanity_filter --- subjects/profanity_filter/README.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/subjects/profanity_filter/README.md b/subjects/profanity_filter/README.md index d56c01605..078b63da1 100644 --- a/subjects/profanity_filter/README.md +++ b/subjects/profanity_filter/README.md @@ -12,7 +12,7 @@ must have the following elements: - content: String - user: String -The `struct` must also have a implementation of 2 **functions** associated with it: +The `struct` must also have an implementation of 2 **functions** associated with it: - `new`, which initializes the structure - `send_ms`, which only has its implementation type (**self**) as argument and returns an option: @@ -37,7 +37,7 @@ pub struct Message { } impl Message { - pub fn new(ms: String, u: String, t: String) -> Message { + pub fn new(ms: String, u: String) -> Message { } pub fn send_ms(&self) -> Option<&str> { @@ -47,10 +47,6 @@ impl Message { pub fn check_ms(ms: &Message) -> (bool, &str) { -} - -pub fn format_date() -> String { - } ``` @@ -62,16 +58,16 @@ Here is a program to test your function use profanity_filter::*; fn main() { - let m0 = Message::new("hello there".to_string(), "toby".to_string(), format_date()); + let m0 = Message::new("hello there".to_string(), "toby".to_string()); println!("{:?}", check_ms(&m0)); - let m1 = Message::new("".to_string(), "toby".to_string(), format_date()); + let m1 = Message::new("".to_string(), "toby".to_string()); println!("{:?}", check_ms(&m1)); - let m2 = Message::new("you are stupid".to_string(), "toby".to_string(), format_date()); + let m2 = Message::new("you are stupid".to_string(), "toby".to_string()); println!("{:?}", check_ms(&m2)); - let m3 = Message::new("stupid".to_string(), "toby".to_string(), format_date()); + let m3 = Message::new("stupid".to_string(), "toby".to_string()); println!("{:?}", check_ms(&m3)); } ```