mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +01:00
A little optimization for utils::escape::escape_html
This commit is contained in:
parent
f42442f3b5
commit
3cc5543cbc
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@ use std::string::String;
|
||||||
// Because they shoudn't be escaped by the spec: https://core.telegram.org/bots/api#html-style
|
// Because they shoudn't be escaped by the spec: https://core.telegram.org/bots/api#html-style
|
||||||
pub fn escape_html(raw: &str) -> String {
|
pub fn escape_html(raw: &str) -> String {
|
||||||
let mut last = 0;
|
let mut last = 0;
|
||||||
let mut out = String::new();
|
let mut out = String::with_capacity(raw.len());
|
||||||
|
|
||||||
for (i, ch) in raw.bytes().enumerate() {
|
for (i, ch) in raw.bytes().enumerate() {
|
||||||
match ch as char {
|
match ch as char {
|
||||||
|
|
Loading…
Add table
Reference in a new issue