Skip to content

Commit de2f7e1

Browse files
committed
Rewrite match to use combinators.
1 parent 7e0c3de commit de2f7e1

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/librustc/traits/error_reporting.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -535,14 +535,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
535535
return;
536536
} else {
537537
let trait_ref = trait_predicate.to_poly_trait_ref();
538-
let (post_message, pre_message) = match self.get_parent_trait_ref(
539-
&obligation.cause.code)
540-
{
541-
Some(t) => {
542-
(format!(" in `{}`", t), format!("within `{}`, ", t))
543-
}
544-
None => (String::new(), String::new()),
545-
};
538+
let (post_message, pre_message) =
539+
self.get_parent_trait_ref(&obligation.cause.code)
540+
.map(|t| (format!(" in `{}`", t), format!("within `{}`, ", t)))
541+
.unwrap_or((String::new(), String::new()));
546542
let mut err = struct_span_err!(
547543
self.tcx.sess,
548544
span,

0 commit comments

Comments
 (0)