Convert nested if block to nested match block
Hi @rohan100jain Can you please review this PR ? Thank you!
A nested if block is rewritten as a more readable nested match block. `match` blocks are also generally more performant than trails of `elif`'s.