mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-08 19:33:53 +01:00
Fix Clippy
This commit is contained in:
parent
8990b4a785
commit
ca8ffba11f
2 changed files with 11 additions and 9 deletions
|
@ -155,11 +155,11 @@ impl BotBuilder {
|
|||
#[must_use]
|
||||
pub fn build(self) -> Bot {
|
||||
Bot {
|
||||
client: self.client.unwrap_or(Client::new()),
|
||||
token: self.token.unwrap_or(
|
||||
client: self.client.unwrap_or_default(),
|
||||
token: self.token.unwrap_or_else(|| {
|
||||
std::env::var("TELOXIDE_TOKEN")
|
||||
.expect("Cannot get the TELOXIDE_TOKEN env variable"),
|
||||
),
|
||||
.expect("Cannot get the TELOXIDE_TOKEN env variable")
|
||||
}),
|
||||
parse_mode: self.parse_mode,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,11 +135,13 @@ fn parse_custom_parser() {
|
|||
))
|
||||
}
|
||||
};
|
||||
left.parse::<u8>().map(|res| (res, right.to_string())).map_err(|_| {
|
||||
ParseError::Custom(
|
||||
"First argument must be a integer!".to_owned().into(),
|
||||
)
|
||||
})
|
||||
left.parse::<u8>().map(|res| (res, (*right).to_string())).map_err(
|
||||
|_| {
|
||||
ParseError::Custom(
|
||||
"First argument must be a integer!".to_owned().into(),
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
#[command(rename = "lowercase")]
|
||||
|
|
Loading…
Reference in a new issue