Skip to content

Commit

Permalink
fixup! refactor(json)!: generalize encoding/decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Sep 10, 2024
1 parent 602d4b9 commit f15b137
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/api/telegram_api_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ impl Api {
Output: serde::de::DeserializeOwned,
{
match response.into_string() {
Ok(message) => serde_json::from_str(&message)
.map_err(|error| Error::Decode(format!("{error:?} : {message:?}"))),
Ok(message) => crate::json::decode(&message),
Err(error) => Err(Error::Decode(format!("{error:?}"))),
}
}
Expand Down

0 comments on commit f15b137

Please sign in to comment.