Refactor: use format-args-capture and remove unnecessary nested if blocks in some parts of rust_passes
#95074
+61
−78