1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-22 11:04: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>
{
fn escape_telegram_html(self) -> String {
let s: String = String::from(self);
let s = s.replace("<", "&lt;");
let s = s.replace(">", "&gt;");
let s = s.replace("&", "&amp;");
s
String::from(self)
.replace("<", "&lt;")
.replace(">", "&gt;")
.replace("&", "&amp;")
}
}