mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +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
|
||||
pub fn escape_html(raw: &str) -> String {
|
||||
let mut last = 0;
|
||||
let mut out = String::new();
|
||||
let mut out = String::with_capacity(raw.len());
|
||||
|
||||
for (i, ch) in raw.bytes().enumerate() {
|
||||
match ch as char {
|
||||
|
|
Loading…
Reference in a new issue