Fix some Clippy's lints

This commit is contained in:
Temirkhan Myrzamadi 2019-10-17 10:46:42 +06:00
parent eee360792a
commit 2fe88cbfe3
2 changed files with 3 additions and 3 deletions

View file

@ -146,7 +146,7 @@ pub fn polling<'a>(bot: &'a Bot) -> impl Updater<Error = RequestError> + 'a {
if let Some(upd) = updates.last() {
offset = upd.id + 1;
}
updates.into_iter().map(|u| Ok(u)).collect::<Vec<_>>()
updates.into_iter().map(Ok).collect::<Vec<_>>()
}
Err(err) => vec![Err(err)],
};

View file

@ -110,7 +110,7 @@ impl IntoFormValue for ChatId {
fn into_form_value(self) -> Option<FormValue> {
let string = match self {
ChatId::Id(id) => id.to_string(),
ChatId::ChannelUsername(username) => username.clone(),
ChatId::ChannelUsername(username) => username,
};
Some(FormValue::Str(string))
}
@ -118,7 +118,7 @@ impl IntoFormValue for ChatId {
impl IntoFormValue for String {
fn into_form_value(self) -> Option<FormValue> {
Some(FormValue::Str(self.to_owned()))
Some(FormValue::Str(self))
}
}