mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-09 11:43:57 +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]
|
#[must_use]
|
||||||
pub fn build(self) -> Bot {
|
pub fn build(self) -> Bot {
|
||||||
Bot {
|
Bot {
|
||||||
client: self.client.unwrap_or(Client::new()),
|
client: self.client.unwrap_or_default(),
|
||||||
token: self.token.unwrap_or(
|
token: self.token.unwrap_or_else(|| {
|
||||||
std::env::var("TELOXIDE_TOKEN")
|
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,
|
parse_mode: self.parse_mode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,11 +135,13 @@ fn parse_custom_parser() {
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
left.parse::<u8>().map(|res| (res, right.to_string())).map_err(|_| {
|
left.parse::<u8>().map(|res| (res, (*right).to_string())).map_err(
|
||||||
ParseError::Custom(
|
|_| {
|
||||||
"First argument must be a integer!".to_owned().into(),
|
ParseError::Custom(
|
||||||
)
|
"First argument must be a integer!".to_owned().into(),
|
||||||
})
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[command(rename = "lowercase")]
|
#[command(rename = "lowercase")]
|
||||||
|
|
Loading…
Reference in a new issue