mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-09 03:43:22 +01:00
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:
parent
09d0d886fa
commit
bd4dba3bf1
1 changed files with 0 additions and 7 deletions
|
@ -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::*;
|
||||
|
|
Loading…
Reference in a new issue