From 0d51e80b6d07788c90a1d6104d1ab637b800f531 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 6 Oct 2015 14:58:15 -0400 Subject: [PATCH] fix some tidy complaints --- src/librustc_mir/build/matches/simplify.rs | 7 ++++--- src/librustc_mir/build/matches/util.rs | 3 ++- src/librustc_mir/hair.rs | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/librustc_mir/build/matches/simplify.rs b/src/librustc_mir/build/matches/simplify.rs index 9114463d61d..69c7fd6598a 100644 --- a/src/librustc_mir/build/matches/simplify.rs +++ b/src/librustc_mir/build/matches/simplify.rs @@ -56,13 +56,14 @@ pub fn simplify_candidate(&mut self, /// Tries to simplify `match_pair`, returning true if /// successful. If successful, new match pairs and bindings will - /// have been pushed into the candidate. On failure (if false is - /// returned), no changes are made to candidate. + /// have been pushed into the candidate. If no simplification is + /// possible, Err is returned and no changes are made to + /// candidate. fn simplify_match_pair(&mut self, mut block: BasicBlock, match_pair: MatchPair<'tcx>, candidate: &mut Candidate<'tcx>) - -> Result> // returns Err() if cannot simplify + -> Result> { match match_pair.pattern.kind { PatternKind::Wild(..) => { diff --git a/src/librustc_mir/build/matches/util.rs b/src/librustc_mir/build/matches/util.rs index d6cc1d088f9..ae6dc9918f4 100644 --- a/src/librustc_mir/build/matches/util.rs +++ b/src/librustc_mir/build/matches/util.rs @@ -27,7 +27,8 @@ pub fn field_match_pairs(&mut self, .collect() } - pub fn match_pair(&mut self, lvalue: Lvalue<'tcx>, pattern: PatternRef<'tcx>) -> MatchPair<'tcx> { + pub fn match_pair(&mut self, lvalue: Lvalue<'tcx>, pattern: PatternRef<'tcx>) + -> MatchPair<'tcx> { let pattern = self.hir.mirror(pattern); MatchPair::new(lvalue, pattern) } diff --git a/src/librustc_mir/hair.rs b/src/librustc_mir/hair.rs index ed776717d37..967ffa5edb1 100644 --- a/src/librustc_mir/hair.rs +++ b/src/librustc_mir/hair.rs @@ -199,7 +199,9 @@ pub enum PatternKind<'tcx> { subpattern: Option> }, // Foo(...) or Foo{...} or Foo, where `Foo` is a variant name from an adt with >1 variants - Variant { adt_def: AdtDef<'tcx>, variant_index: usize, subpatterns: Vec> }, + Variant { adt_def: AdtDef<'tcx>, + variant_index: usize, + subpatterns: Vec> }, // (...), Foo(...), Foo{...}, or Foo, where `Foo` is a variant name from an adt with 1 variant Leaf { subpatterns: Vec> },