Single line if (without else) statement #6369
Unanswered
Cationiz3r
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all, I was working on a project of mine when I found that
rustfmt
was always expanding shortif
statements.For example, I have a function that adds cached items into a redis server, which would always fail if the items list is empty, so the following code snippet is used:
However, by default,
rustfmt
always expand it to:which takes 2 extra lines.
Is there an option I can use to compact it into the first snippet?
Beta Was this translation helpful? Give feedback.
All reactions