about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-04-26 11:32:06 +0200
committerRalf Jung <post@ralfj.de>2023-04-26 11:42:06 +0200
commit78f11a2f83e0c989f3de750697a89a856e9782ae (patch)
tree2f42c765e1ef5f4da25e646a55e048414ec95b8b
parentbd5c1d41f7e2e211a067ad72e32f25e43573905d (diff)
downloadrust-78f11a2f83e0c989f3de750697a89a856e9782ae.tar.gz
rust-78f11a2f83e0c989f3de750697a89a856e9782ae.zip
fmt
-rw-r--r--src/tools/miri/src/concurrency/thread.rs5
-rw-r--r--src/tools/miri/src/concurrency/vector_clock.rs28
2 files changed, 16 insertions, 17 deletions
diff --git a/src/tools/miri/src/concurrency/thread.rs b/src/tools/miri/src/concurrency/thread.rs
index a8e4a5fa3dd..e9bbae4d504 100644
--- a/src/tools/miri/src/concurrency/thread.rs
+++ b/src/tools/miri/src/concurrency/thread.rs
@@ -272,9 +272,8 @@ impl Time {
     fn get_wait_time(&self, clock: &Clock) -> Duration {
         match self {
             Time::Monotonic(instant) => instant.duration_since(clock.now()),
-            Time::RealTime(time) => {
-                time.duration_since(SystemTime::now()).unwrap_or(Duration::new(0, 0))
-            }
+            Time::RealTime(time) =>
+                time.duration_since(SystemTime::now()).unwrap_or(Duration::new(0, 0)),
         }
     }
 }
diff --git a/src/tools/miri/src/concurrency/vector_clock.rs b/src/tools/miri/src/concurrency/vector_clock.rs
index b36c6be5a72..a6e67ef8699 100644
--- a/src/tools/miri/src/concurrency/vector_clock.rs
+++ b/src/tools/miri/src/concurrency/vector_clock.rs
@@ -212,16 +212,14 @@ impl PartialOrd for VClock {
         for (l, r) in iter {
             match order {
                 Ordering::Equal => order = l.cmp(r),
-                Ordering::Less => {
+                Ordering::Less =>
                     if l > r {
                         return None;
-                    }
-                }
-                Ordering::Greater => {
+                    },
+                Ordering::Greater =>
                     if l < r {
                         return None;
-                    }
-                }
+                    },
             }
         }
 
@@ -236,16 +234,18 @@ impl PartialOrd for VClock {
             Ordering::Equal => Some(order),
             // Right has at least 1 element > than the implicit 0,
             // so the only valid values are Ordering::Less or None.
-            Ordering::Less => match order {
-                Ordering::Less | Ordering::Equal => Some(Ordering::Less),
-                Ordering::Greater => None,
-            },
+            Ordering::Less =>
+                match order {
+                    Ordering::Less | Ordering::Equal => Some(Ordering::Less),
+                    Ordering::Greater => None,
+                },
             // Left has at least 1 element > than the implicit 0,
             // so the only valid values are Ordering::Greater or None.
-            Ordering::Greater => match order {
-                Ordering::Greater | Ordering::Equal => Some(Ordering::Greater),
-                Ordering::Less => None,
-            },
+            Ordering::Greater =>
+                match order {
+                    Ordering::Greater | Ordering::Equal => Some(Ordering::Greater),
+                    Ordering::Less => None,
+                },
         }
     }