From 70d5b50f4cb999ebeae95e53ed26c0d3cacaf43b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 17 Mar 2022 18:26:09 +0100 Subject: [PATCH] Improve code readability --- src/utils/string_utils.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/utils/string_utils.rs b/src/utils/string_utils.rs index 5006f20..5549dc9 100644 --- a/src/utils/string_utils.rs +++ b/src/utils/string_utils.rs @@ -19,8 +19,8 @@ use regex::Regex; /// assert_eq!(res1, "<b>hello world</b>"); /// ``` pub fn remove_html_nodes(input: &str) -> String { - input.replace("<", "<") - .replace(">", ">") + input.replace('<', "<") + .replace('>', ">") } /// Check out whether a URL is valid or not @@ -64,14 +64,14 @@ pub fn check_string_before_insert(s: &str) -> bool { /// ``` pub fn check_youtube_id(id: &str) -> bool { id.len() >= 5 - && !id.contains("/") - && !id.contains("\\") - && !id.contains("@") - && !id.contains("&") - && !id.contains("?") - && !id.contains(".") - && !id.contains("'") - && !id.contains("\"") + && !id.contains('/') + && !id.contains('\\') + && !id.contains('@') + && !id.contains('&') + && !id.contains('?') + && !id.contains('.') + && !id.contains('\'') + && !id.contains('\"') }