diff --git a/examples/async_custom_client.rs b/examples/async_custom_client.rs index 5e38116..fd1ecfc 100644 --- a/examples/async_custom_client.rs +++ b/examples/async_custom_client.rs @@ -1,4 +1,3 @@ -use frankenstein::reqwest; use frankenstein::AsyncApi; use frankenstein::AsyncTelegramApi; use std::time::Duration; @@ -26,7 +25,7 @@ async fn main() { } fn custom_client() -> AsyncApi { - let client = reqwest::ClientBuilder::new() + let client = frankenstein::reqwest::ClientBuilder::new() .connect_timeout(Duration::from_secs(100)) .timeout(Duration::from_secs(100)) .build() diff --git a/examples/custom_client.rs b/examples/custom_client.rs index 3342eef..4a6b462 100644 --- a/examples/custom_client.rs +++ b/examples/custom_client.rs @@ -1,4 +1,3 @@ -use frankenstein::ureq; use frankenstein::Api; use frankenstein::TelegramApi; use std::time::Duration; @@ -25,7 +24,9 @@ fn main() { } fn custom_client() -> Api { - let request_agent = ureq::builder().timeout(Duration::from_secs(100)).build(); + let request_agent = frankenstein::ureq::builder() + .timeout(Duration::from_secs(100)) + .build(); let api_url = format!("{BASE_API_URL}{TOKEN}"); Api::builder() diff --git a/src/api/telegram_api_impl.rs b/src/api/telegram_api_impl.rs index de6ddcf..e14a297 100644 --- a/src/api/telegram_api_impl.rs +++ b/src/api/telegram_api_impl.rs @@ -27,7 +27,7 @@ impl Api { /// Create a new `Api`. You can use `Api::builder()` for more options. pub fn new_url>(api_url: T) -> Self { - Api::builder().api_url(api_url).build() + Self::builder().api_url(api_url).build() } pub fn encode_params( diff --git a/src/objects.rs b/src/objects.rs index 01951f3..8c6b059 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -1069,13 +1069,13 @@ pub enum MessageOrigin { Channel(MessageOriginChannel), } -#[derive(Builder, Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Builder, Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct MessageOriginUser { pub date: u64, pub sender_user: User, } -#[derive(Builder, Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Builder, Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct MessageOriginHiddenUser { pub date: u64, #[builder(setter(into))] @@ -1990,7 +1990,7 @@ pub struct ReactionTypeCustomEmoji { pub custom_emoji_id: String, } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct ReactionCount { #[builder(setter(into))] #[serde(rename = "type")] @@ -3510,7 +3510,7 @@ pub struct GameHighScore { pub score: i32, } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct GiveawayCreated {} #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] @@ -3722,7 +3722,7 @@ pub struct ChatBoostRemoved { pub source: ChatBoostSource, } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Builder)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)] pub struct UserChatBoosts { pub boosts: Vec, } diff --git a/src/parse_mode.rs b/src/parse_mode.rs index 10537e4..6954032 100644 --- a/src/parse_mode.rs +++ b/src/parse_mode.rs @@ -20,9 +20,9 @@ impl FromStr for ParseMode { type Err = (); fn from_str(s: &str) -> Result { match s { - "HTML" | "Html" | "html" => Ok(ParseMode::Html), - "Markdown" | "markdown" => Ok(ParseMode::Markdown), - "MarkdownV2" | "markdownv2" => Ok(ParseMode::MarkdownV2), + "HTML" | "Html" | "html" => Ok(Self::Html), + "Markdown" | "markdown" => Ok(Self::Markdown), + "MarkdownV2" | "markdownv2" => Ok(Self::MarkdownV2), _ => Err(()), } } @@ -31,9 +31,9 @@ impl FromStr for ParseMode { impl ParseMode { pub const fn to_str(self) -> &'static str { match self { - ParseMode::Html => "HTML", - ParseMode::MarkdownV2 => "MarkdownV2", - ParseMode::Markdown => "Markdown", + Self::Html => "HTML", + Self::MarkdownV2 => "MarkdownV2", + Self::Markdown => "Markdown", } } }