mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
proc, input, output: cleanup warnings
This commit is contained in:
parent
ab07fd2b43
commit
60c0771024
6 changed files with 32 additions and 93 deletions
|
|
@ -22,18 +22,13 @@ impl<A, B> Either<A, B> {
|
|||
try_from_expr!(<'source, 'state, E>: When<RenderBox<'state, E>>: |state, iter| {
|
||||
if let Some(Token { value: Value::Key("when"), .. }) = iter.peek() {
|
||||
let _ = iter.next().unwrap();
|
||||
|
||||
let condition = iter.next().expect("no condition specified");
|
||||
let condition = state.get(&mut iter).expect("no condition provided");
|
||||
|
||||
let content = iter.next().expect("no content specified");
|
||||
let content = if let Some(content) = state.get_content(&content.value) {
|
||||
content
|
||||
} else {
|
||||
panic!("no content corresponding to for {:?}", &content);
|
||||
};
|
||||
|
||||
return Some(Self(condition, content))
|
||||
let content = iter.next().expect("no content specified").value;
|
||||
return Some(Self(
|
||||
state.get(&mut iter)
|
||||
.expect("no condition provided"),
|
||||
state.get_content(&content)
|
||||
.unwrap_or_else(||panic!("no content corresponding to for {:?}", &content))
|
||||
))
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -41,25 +36,16 @@ try_from_expr!(<'source, 'state, E>: When<RenderBox<'state, E>>: |state, iter| {
|
|||
try_from_expr!(<'source, 'state, E>: Either<RenderBox<'state, E>, RenderBox<'state, E>>: |state, iter| {
|
||||
if let Some(Token { value: Value::Key("either"), .. }) = iter.peek() {
|
||||
let _ = iter.next().unwrap();
|
||||
|
||||
let condition = iter.next().expect("no condition specified");
|
||||
let condition = state.get(&mut iter).expect("no condition provided");
|
||||
|
||||
let content = iter.next().expect("no content specified");
|
||||
let content = if let Some(content) = state.get_content(&content.value) {
|
||||
content
|
||||
} else {
|
||||
panic!("no content 1 corresponding to {:?}", &content);
|
||||
};
|
||||
|
||||
let alternate = iter.next().expect("no alternate specified");
|
||||
let alternate = if let Some(alternate) = state.get_content(&alternate.value) {
|
||||
alternate
|
||||
} else {
|
||||
panic!("no content 2 corresponding to {:?}", &alternate);
|
||||
};
|
||||
|
||||
return Some(Self(condition, content, alternate))
|
||||
let content = iter.next().expect("no content specified").value;
|
||||
let alternate = iter.next().expect("no alternate specified").value;
|
||||
return Some(Self(
|
||||
state.get(&mut iter)
|
||||
.expect("no condition provided"),
|
||||
state.get_content(&content)
|
||||
.unwrap_or_else(||panic!("no content 1 corresponding to {:?}", &content)),
|
||||
state.get_content(&alternate)
|
||||
.unwrap_or_else(||panic!("no content 2 corresponding to {:?}", &alternate)),
|
||||
))
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue