mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Fix network/mod.rs
This commit is contained in:
parent
7ec19d23c2
commit
c6f818e8bb
4 changed files with 7 additions and 6 deletions
|
@ -29,7 +29,7 @@ fn file_url(base: &str, token: &str, file_path: &str) -> String {
|
|||
)
|
||||
}
|
||||
|
||||
#[derive(Debug, Display, PartialEq, Eq)]
|
||||
#[derive(Debug, Display)]
|
||||
pub enum RequestError {
|
||||
#[display(fmt = "Telegram error #{}: {}", status_code, description)]
|
||||
ApiError {
|
||||
|
@ -48,8 +48,8 @@ impl std::error::Error for RequestError {
|
|||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
match self {
|
||||
RequestError::ApiError { .. } => None,
|
||||
RequestError::NetworkError(err) => err,
|
||||
RequestError::InvalidJson(err) => err,
|
||||
RequestError::NetworkError(err) => Some(err),
|
||||
RequestError::InvalidJson(err) => Some(err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,8 @@ pub struct InlineKeyboardButton {
|
|||
#[derive(Debug, Clone, PartialEq, PartialOrd, Serialize)]
|
||||
pub enum InlineKeyboardButtonKind {
|
||||
#[serde(rename = "url")]
|
||||
Url(String), // TODO(knsd): Url?
|
||||
Url(String),
|
||||
// TODO(knsd): Url?
|
||||
#[serde(rename = "callback_data")]
|
||||
CallbackData(String), // TODO(knsd) Validate size?
|
||||
// SwitchInlineQuery(String),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::{PhotoSize, MaskPosition};
|
||||
use crate::core::types::{MaskPosition, PhotoSize};
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct Sticker {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
use crate::core::types::{Sticker};
|
||||
use crate::core::types::Sticker;
|
||||
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct Sticker {
|
||||
|
|
Loading…
Reference in a new issue