about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2016-10-19 23:15:01 +0200
committerGitHub <noreply@github.com>2016-10-19 23:15:01 +0200
commit655ecd89edbd8f6af1486cec1c5746a74291d387 (patch)
treee1e2984aa363df5d3a1e099f15bad7a594176e07
parente7dc035f92c2e753c2a8b2cb6a6e80dbf2dd5d34 (diff)
parentc2d0d4fea6598c6d366b23d45b76b9c0572e7ac4 (diff)
downloadrust-655ecd89edbd8f6af1486cec1c5746a74291d387.tar.gz
rust-655ecd89edbd8f6af1486cec1c5746a74291d387.zip
Rollup merge of #37287 - srinivasreddy:unify, r=eddyb
run rustfmt on unify folder
-rw-r--r--src/librustc_data_structures/unify/mod.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/librustc_data_structures/unify/mod.rs b/src/librustc_data_structures/unify/mod.rs
index 3feea3218d0..1f4d09a9224 100644
--- a/src/librustc_data_structures/unify/mod.rs
+++ b/src/librustc_data_structures/unify/mod.rs
@@ -27,7 +27,7 @@ mod tests;
 ///
 /// Clients are expected to provide implementations of this trait; you
 /// can see some examples in the `test` module.
-pub trait UnifyKey : Copy + Clone + Debug + PartialEq {
+pub trait UnifyKey: Copy + Clone + Debug + PartialEq {
     type Value: Clone + PartialEq + Debug;
 
     fn index(&self) -> u32;
@@ -115,11 +115,7 @@ impl<K: UnifyKey> VarValue<K> {
     }
 
     fn if_not_self(&self, key: K, self_key: K) -> Option<K> {
-        if key == self_key {
-            None
-        } else {
-            Some(key)
-        }
+        if key == self_key { None } else { Some(key) }
     }
 }
 
@@ -236,7 +232,8 @@ impl<K: UnifyKey> UnificationTable<K> {
                      new_rank: u32,
                      old_root: VarValue<K>,
                      new_root: VarValue<K>,
-                     new_value: K::Value) -> K {
+                     new_value: K::Value)
+                     -> K {
         let old_root_key = old_root.key();
         let new_root_key = new_root.key();
         self.set(old_root_key, old_root.redirect(new_root_key));
@@ -306,7 +303,8 @@ impl<'tcx, K, V> UnificationTable<K>
         let combined = {
             match (&node_a.value, &node_b.value) {
                 (&None, &None) => None,
-                (&Some(ref v), &None) | (&None, &Some(ref v)) => Some(v.clone()),
+                (&Some(ref v), &None) |
+                (&None, &Some(ref v)) => Some(v.clone()),
                 (&Some(ref v1), &Some(ref v2)) => {
                     if *v1 != *v2 {
                         return Err((v1.clone(), v2.clone()));