Mixing optional and non-optional functions in a guard is impossible and requires breaking up the lines. Here's a neat solution on how to circumvent this.
#let — 2 posts.
Three quick examples for how you can use guard to write shorter and simpler code