if $c:expr { Some($r:expr) } else { None }
$c.then(|| $r)
Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.