fmt
This commit is contained in:
parent
bd5c1d41f7
commit
78f11a2f83
2 changed files with 16 additions and 17 deletions
|
|
@ -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)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue