Skip to content

Commit

Permalink
run rustfmt on unify folder
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddy committed Oct 19, 2016
1 parent a41505f commit c2d0d4f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/librustc_data_structures/unify/mod.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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) }
}
}

Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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()));
Expand Down

0 comments on commit c2d0d4f

Please sign in to comment.