Use `if let` statement in generated code

(I'd like Rust to have more generic `is` expression:
https://github.com/rust-lang/rfcs/pull/160#issuecomment-48449546 )