summaryrefslogtreecommitdiff
path: root/src/eval
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-09-14 12:27:21 +0200
committerLaurenz <laurmaedje@gmail.com>2021-09-14 12:27:21 +0200
commit87e776fcebd40cb9628124c19e7e9190b1bd24a5 (patch)
tree3276e39130dc112a11c2594a3b470687e91a1a36 /src/eval
parent18190f377a556ae5d5bb855044a95ecea071432f (diff)
Add `BoolExt` trait with `flip` method
Diffstat (limited to 'src/eval')
-rw-r--r--src/eval/walk.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/eval/walk.rs b/src/eval/walk.rs
index 7ffb4c05..3b9fc094 100644
--- a/src/eval/walk.rs
+++ b/src/eval/walk.rs
@@ -5,6 +5,7 @@ use crate::diag::TypResult;
use crate::geom::Gen;
use crate::layout::{ParChild, ParNode, StackChild, StackNode};
use crate::syntax::*;
+use crate::util::BoolExt;
/// Walk a syntax node and fill the currently built template.
pub trait Walk {
@@ -27,8 +28,8 @@ impl Walk for SyntaxNode {
Self::Space => ctx.template.space(),
Self::Linebreak(_) => ctx.template.linebreak(),
Self::Parbreak(_) => ctx.template.parbreak(),
- Self::Strong(_) => ctx.template.modify(|s| s.font_mut().strong ^= true),
- Self::Emph(_) => ctx.template.modify(|s| s.font_mut().emph ^= true),
+ Self::Strong(_) => ctx.template.modify(|s| s.font_mut().strong.flip()),
+ Self::Emph(_) => ctx.template.modify(|s| s.font_mut().emph.flip()),
Self::Text(text) => ctx.template.text(text),
Self::Raw(raw) => raw.walk(ctx)?,
Self::Heading(heading) => heading.walk(ctx)?,