diff options
| author | jfager <jfager@gmail.com> | 2014-11-29 16:41:21 -0500 |
|---|---|---|
| committer | jfager <jfager@gmail.com> | 2014-11-29 16:41:21 -0500 |
| commit | 232ffa039ddb349c9e9c08d0872aaf95970a1369 (patch) | |
| tree | e502451f6717605305e19c8fbcc8902f617c0a36 /src/librustc/plugin | |
| parent | 6163581451a089a8d07bed4dba058677ee4a21f3 (diff) | |
| download | rust-232ffa039ddb349c9e9c08d0872aaf95970a1369.tar.gz rust-232ffa039ddb349c9e9c08d0872aaf95970a1369.zip | |
Replace some verbose match statements with their `if let` equivalent.
No semantic changes, no enabling `if let` where it wasn't already enabled.
Diffstat (limited to 'src/librustc/plugin')
| -rw-r--r-- | src/librustc/plugin/build.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/librustc/plugin/build.rs b/src/librustc/plugin/build.rs index 457fcb861e6..a8018662d29 100644 --- a/src/librustc/plugin/build.rs +++ b/src/librustc/plugin/build.rs @@ -23,14 +23,11 @@ struct RegistrarFinder { impl<'v> Visitor<'v> for RegistrarFinder { fn visit_item(&mut self, item: &ast::Item) { - match item.node { - ast::ItemFn(..) => { - if attr::contains_name(item.attrs.as_slice(), - "plugin_registrar") { - self.registrars.push((item.id, item.span)); - } + if let ast::ItemFn(..) = item.node { + if attr::contains_name(item.attrs.as_slice(), + "plugin_registrar") { + self.registrars.push((item.id, item.span)); } - _ => {} } visit::walk_item(self, item); |
