Use serde_json::from_value in Update::try_parse

This commit is contained in:
Temirkhan Myrzamadi 2021-03-13 21:38:05 +06:00
parent cd9a98163c
commit e400fb16e7

View file

@ -34,7 +34,7 @@ impl Update {
///
/// It is used to implement update listeners.
pub fn try_parse(value: &Value) -> Result<Self, serde_json::Error> {
match serde_json::from_str(&value.to_string()) {
match serde_json::from_value(value.clone()) {
Ok(update) => Ok(update),
Err(error) => {
log::error!(