mirror of
https://github.com/dtolnay/thiserror.git
synced 2025-04-04 13:27:38 +03:00
Resolve iter_skip_next lint
This commit is contained in:
parent
5994705b38
commit
ab48dd19d3
1 changed files with 2 additions and 2 deletions
|
@ -78,12 +78,12 @@ impl ToTokens for Display {
|
|||
let fmt = &self.fmt;
|
||||
let args = &self.args;
|
||||
if self.was_shorthand && fmt.value() == "{}" {
|
||||
let arg = args.clone().into_iter().skip(1).next().unwrap();
|
||||
let arg = args.clone().into_iter().nth(1).unwrap();
|
||||
tokens.extend(quote! {
|
||||
std::fmt::Display::fmt(#arg, formatter)
|
||||
});
|
||||
} else if self.was_shorthand && fmt.value() == "{:?}" {
|
||||
let arg = args.clone().into_iter().skip(1).next().unwrap();
|
||||
let arg = args.clone().into_iter().nth(1).unwrap();
|
||||
tokens.extend(quote! {
|
||||
std::fmt::Debug::fmt(#arg, formatter)
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue