Fix Clippy

This commit is contained in:
Temirkhan Myrzamadi 2020-07-16 20:02:39 +06:00
parent 8990b4a785
commit ca8ffba11f
2 changed files with 11 additions and 9 deletions

View file

@ -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,
}
}

View file

@ -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")]