1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-25 20:44:21 +00:00

Simplify escape_telegram_html

This commit is contained in:
Steffo 2024-08-08 00:44:25 +02:00
parent ebfcfe45e3
commit bcb1793f00
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -19,10 +19,9 @@ impl<T> TelegramEscape for T
where String: From<T> where String: From<T>
{ {
fn escape_telegram_html(self) -> String { fn escape_telegram_html(self) -> String {
let s: String = String::from(self); String::from(self)
let s = s.replace("<", "&lt;"); .replace("<", "&lt;")
let s = s.replace(">", "&gt;"); .replace(">", "&gt;")
let s = s.replace("&", "&amp;"); .replace("&", "&amp;")
s
} }
} }