Remove MessageEntity::text_from because it's wrong

(the method assumes UTF-8 indices, but the indices are UTF-16)
(fuck you, telegram)
This commit is contained in:
Waffle 2021-01-26 16:21:47 +03:00
parent 09d0d886fa
commit bd4dba3bf1

View file

@ -65,13 +65,6 @@ pub enum MessageEntityKind {
Strikethrough,
}
impl MessageEntity {
pub fn text_from(&self, message: &Message) -> Option<String> {
let text = message.text();
Some(String::from(&text?[self.offset..self.offset + self.length]))
}
}
#[cfg(test)]
mod tests {
use super::*;