Adjust to_attr_token_stream
.
It uses `once` chained with `(0..self.num_calls).map(...)` followed by `.take(self.num_calls`. I found this hard to read. It's simpler to just use `repeat_with`.
This commit is contained in:
parent
58e967a9cc
commit
42dbc72d7b
1 changed files with 1 additions and 1 deletions
|
@ -106,7 +106,7 @@ impl ToAttrTokenStream for LazyAttrTokenStreamImpl {
|
|||
let mut cursor_snapshot = self.cursor_snapshot.clone();
|
||||
let tokens =
|
||||
std::iter::once((FlatToken::Token(self.start_token.0.clone()), self.start_token.1))
|
||||
.chain((0..self.num_calls).map(|_| {
|
||||
.chain(std::iter::repeat_with(|| {
|
||||
let token = cursor_snapshot.next();
|
||||
(FlatToken::Token(token.0), token.1)
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue