Skip to content

Commit f894ffb

Browse files
author
Stephan Dilly
committed
clippy fix
1 parent 51b1440 commit f894ffb

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

asyncgit/src/revlog.rs

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,22 @@ impl AsyncLog {
8080

8181
///
8282
pub fn fetch(&mut self) -> Result<()> {
83-
if !self.is_pending() {
84-
if self.head_changed()? {
85-
self.clear()?;
86-
87-
let arc_current = Arc::clone(&self.current);
88-
let sender = self.sender.clone();
89-
let arc_pending = Arc::clone(&self.pending);
90-
91-
rayon_core::spawn(move || {
92-
scope_time!("async::revlog");
93-
94-
arc_pending.store(true, Ordering::Relaxed);
95-
AsyncLog::fetch_helper(arc_current, &sender)
96-
.expect("failed to fetch");
97-
arc_pending.store(false, Ordering::Relaxed);
98-
Self::notify(&sender);
99-
});
100-
}
83+
if !self.is_pending() && self.head_changed()? {
84+
self.clear()?;
85+
86+
let arc_current = Arc::clone(&self.current);
87+
let sender = self.sender.clone();
88+
let arc_pending = Arc::clone(&self.pending);
89+
90+
rayon_core::spawn(move || {
91+
scope_time!("async::revlog");
92+
93+
arc_pending.store(true, Ordering::Relaxed);
94+
AsyncLog::fetch_helper(arc_current, &sender)
95+
.expect("failed to fetch");
96+
arc_pending.store(false, Ordering::Relaxed);
97+
Self::notify(&sender);
98+
});
10199
}
102100
Ok(())
103101
}

0 commit comments

Comments
 (0)