diff --git a/examples/async_reply_to_message_updates.rs b/examples/async_reply_to_message_updates.rs index a2e1827..40681a2 100644 --- a/examples/async_reply_to_message_updates.rs +++ b/examples/async_reply_to_message_updates.rs @@ -42,14 +42,12 @@ async fn process_message(message: Message, api: AsyncApi) { let reply_parameters = ReplyParameters::builder() .message_id(message.message_id) .build(); - let send_message_params = SendMessageParams::builder() .chat_id(message.chat.id) .text("hello") .reply_parameters(reply_parameters) .build(); - - if let Err(err) = api.send_message(&send_message_params).await { - println!("Failed to send message: {err:?}"); + if let Err(error) = api.send_message(&send_message_params).await { + println!("Failed to send message: {error:?}"); } } diff --git a/examples/reply_to_message_updates.rs b/examples/reply_to_message_updates.rs index 2c13873..8531c34 100644 --- a/examples/reply_to_message_updates.rs +++ b/examples/reply_to_message_updates.rs @@ -23,15 +23,13 @@ fn main() { let reply_parameters = ReplyParameters::builder() .message_id(message.message_id) .build(); - let send_message_params = SendMessageParams::builder() .chat_id(message.chat.id) .text("hello") .reply_parameters(reply_parameters) .build(); - - if let Err(err) = api.send_message(&send_message_params) { - println!("Failed to send message: {err:?}"); + if let Err(error) = api.send_message(&send_message_params) { + println!("Failed to send message: {error:?}"); } } update_params.offset = Some(i64::from(update.update_id) + 1); diff --git a/src/api/async_telegram_api_impl.rs b/src/api/async_telegram_api_impl.rs index 9d83075..53254ca 100644 --- a/src/api/async_telegram_api_impl.rs +++ b/src/api/async_telegram_api_impl.rs @@ -34,7 +34,7 @@ impl AsyncApi { where Params: serde::ser::Serialize + std::fmt::Debug, { - serde_json::to_string(params).map_err(|e| Error::Encode(format!("{e:?} : {params:?}"))) + serde_json::to_string(params).map_err(|err| Error::Encode(format!("{err:?} : {params:?}"))) } pub async fn decode_response(response: reqwest::Response) -> Result @@ -50,12 +50,12 @@ impl AsyncApi { Err(Error::Api(Self::parse_json(&message)?)) } } - Err(e) => Err(Error::Decode(format!("Failed to decode response: {e:?}"))), + Err(error) => Err(Error::Decode(format!("{error:?}"))), } } fn parse_json(body: &str) -> Result { - serde_json::from_str(body).map_err(|e| Error::Decode(format!("{e:?} : {body:?}"))) + serde_json::from_str(body).map_err(|error| Error::Decode(format!("{error:?} : {body:?}"))) } } @@ -134,7 +134,7 @@ impl AsyncTelegramApi for AsyncApi { for (parameter_name, file_path, file_name) in files_with_paths { let file = File::open(file_path) .await - .map_err(|err| Error::Encode(err.to_string()))?; + .map_err(|error| Error::Encode(error.to_string()))?; let part = multipart::Part::stream(file).file_name(file_name); form = form.part(parameter_name, part); } diff --git a/src/api/telegram_api_impl.rs b/src/api/telegram_api_impl.rs index ca63d4d..d135b20 100644 --- a/src/api/telegram_api_impl.rs +++ b/src/api/telegram_api_impl.rs @@ -31,7 +31,7 @@ impl Api { where Params: serde::ser::Serialize + std::fmt::Debug, { - serde_json::to_string(params).map_err(|e| Error::Encode(format!("{e:?} : {params:?}"))) + serde_json::to_string(params).map_err(|err| Error::Encode(format!("{err:?} : {params:?}"))) } pub fn decode_response(response: Response) -> Result @@ -41,7 +41,7 @@ impl Api { match response.into_string() { Ok(message) => serde_json::from_str(&message) .map_err(|error| Error::Decode(format!("{error:?} : {message:?}"))), - Err(e) => Err(Error::Decode(format!("Failed to decode response: {e:?}"))), + Err(error) => Err(Error::Decode(format!("{error:?}"))), } } }