Skip to content

Commit 9213d20

Browse files
author
Matt Wilkinson
committed
fmt
1 parent 1d2ea75 commit 9213d20

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

library/std/src/io/mod.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -2224,11 +2224,7 @@ impl<T: Read, U: Read> Read for Chain<T, U> {
22242224

22252225
unsafe fn initializer(&self) -> Initializer {
22262226
let initializer = self.first.initializer();
2227-
if initializer.should_initialize() {
2228-
initializer
2229-
} else {
2230-
self.second.initializer()
2231-
}
2227+
if initializer.should_initialize() { initializer } else { self.second.initializer() }
22322228
}
22332229
}
22342230

@@ -2247,11 +2243,7 @@ impl<T: BufRead, U: BufRead> BufRead for Chain<T, U> {
22472243
}
22482244

22492245
fn consume(&mut self, amt: usize) {
2250-
if !self.done_first {
2251-
self.first.consume(amt)
2252-
} else {
2253-
self.second.consume(amt)
2254-
}
2246+
if !self.done_first { self.first.consume(amt) } else { self.second.consume(amt) }
22552247
}
22562248
}
22572249

library/test/src/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,7 @@ where
292292
fn calc_timeout(timeout_queue: &VecDeque<TimeoutEntry>) -> Option<Duration> {
293293
timeout_queue.front().map(|&TimeoutEntry { timeout: next_timeout, .. }| {
294294
let now = Instant::now();
295-
if next_timeout >= now {
296-
next_timeout - now
297-
} else {
298-
Duration::new(0, 0)
299-
}
295+
if next_timeout >= now { next_timeout - now } else { Duration::new(0, 0) }
300296
})
301297
}
302298

0 commit comments

Comments
 (0)