mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 20:56:43 +01:00
iterator being const when not needed
This commit is contained in:
parent
67148a4aa4
commit
a595e2e895
4 changed files with 36 additions and 46 deletions
|
|
@ -7,7 +7,7 @@ pub struct Either<A, B>(pub bool, pub A, pub B);
|
|||
impl<A, B> Either<A, B> { pub fn new (c: bool, a: A, b: B) -> Self { Self(c, a, b) } }
|
||||
try_from_expr!(<'a, E>: When<RenderBox<'a, E>>: |state, iter| {
|
||||
if let Some(Token { value: Value::Key("when"), .. }) = iter.peek() {
|
||||
let iter = iter.clone();
|
||||
let iter = iter.clone().next().unwrap().1;
|
||||
let condition = iter.next();
|
||||
if let Some((ref condition, _)) = condition {
|
||||
let condition = state.get(&condition.value).expect("no condition");
|
||||
|
|
@ -20,7 +20,7 @@ try_from_expr!(<'a, E>: When<RenderBox<'a, E>>: |state, iter| {
|
|||
});
|
||||
try_from_expr!(<'a, E>: Either<RenderBox<'a, E>, RenderBox<'a, E>>: |state, iter| {
|
||||
if let Some((Token { value: Value::Key("either"), .. }, _)) = iter.next() {
|
||||
let iter = iter.clone();
|
||||
let iter = iter.clone().next().unwrap().1;
|
||||
let condition = iter.next();
|
||||
if let Some((ref condition, _)) = condition {
|
||||
let condition = state.get(&condition.value).expect("no condition");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue