]> git.lizzy.rs Git - rust.git/commit
prefer `if let` to match with `None => ()` arm in some places
authorZack M. Davis <code@zackmdavis.net>
Tue, 14 Jun 2016 05:43:30 +0000 (22:43 -0700)
committerZack M. Davis <code@zackmdavis.net>
Wed, 15 Jun 2016 15:13:10 +0000 (08:13 -0700)
commit8531d581046ad782e19ee0e877ef3819a7c123ba
treeb2c8a37b33e7b9b6af3a18803020a7cffc2b4f89
parent6551acc8e560d242f317f4fe4324be0962c5db75
prefer `if let` to match with `None => ()` arm in some places

Casual grepping revealed some places in the codebase (some of which
antedated `if let`'s December 2014 stabilization in c200ae5a) where we
were using a match with a `None => ()` arm where (in the present
author's opinion) an `if let` conditional would be more readable. (Other
places where matching to the unit value did seem to better express the
intent were left alone.)

It's likely that we don't care about making such trivial,
non-functional, sheerly æsthetic changes.

But if we do, this is a patch.
src/librustc/hir/print.rs
src/librustc/infer/error_reporting.rs
src/librustc/middle/dead.rs
src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs
src/librustc_metadata/creader.rs
src/librustc_trans/base.rs
src/librustc_trans/debuginfo/metadata.rs
src/librustc_trans/monomorphize.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pprust.rs
src/libsyntax/util/interner.rs