From bcb1793f008f6451d3019206875e1bf9e39409cb Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 8 Aug 2024 00:44:25 +0200 Subject: [PATCH] Simplify `escape_telegram_html` --- src/utils/telegramdisplay.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/utils/telegramdisplay.rs b/src/utils/telegramdisplay.rs index f7145961..165e4ef5 100644 --- a/src/utils/telegramdisplay.rs +++ b/src/utils/telegramdisplay.rs @@ -19,10 +19,9 @@ impl TelegramEscape for T where String: From { fn escape_telegram_html(self) -> String { - let s: String = String::from(self); - let s = s.replace("<", "<"); - let s = s.replace(">", ">"); - let s = s.replace("&", "&"); - s + String::from(self) + .replace("<", "<") + .replace(">", ">") + .replace("&", "&") } }