Skip to content

Commit 6480e87

Browse files
authored
Merge branch 'Xudong-Huang:master' into master
2 parents ed30f06 + 1dd0f6c commit 6480e87

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fastrand = { version = "2.0", optional = true }
3838
may_queue = { version = "0.1", path = "may_queue" }
3939

4040
[target.'cfg(unix)'.dependencies]
41-
nix = { version = "0.30", features = ["event", "socket"] }
41+
nix = { version = "0.31", features = ["event", "socket"] }
4242
libc = "0.2"
4343

4444
[target.'cfg(windows)'.dependencies.windows-sys]
@@ -62,7 +62,7 @@ docopt = "1.0"
6262
httparse = "1.1"
6363
tempfile = "3"
6464
native-tls = "0.2"
65-
tungstenite = "0.28"
65+
tungstenite = "0.29"
6666
serde_derive = "1.0"
6767

6868
[features]

src/timeout_list.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,18 +189,14 @@ impl<T> TimeOutList<T> {
189189
// first peek the BH to see if there is any timeout event
190190
let mut entry = {
191191
let mut timer_bh = self.timer_bh.lock();
192-
let top_entry = timer_bh.peek();
193-
match top_entry {
194-
// the latest timeout event not happened yet
195-
Some(entry) => {
196-
if entry.time > now {
197-
return Some(entry.time - now);
198-
} else {
199-
// find out one entry
200-
}
201-
}
202-
None => return None,
192+
let top_entry = timer_bh.peek()?;
193+
194+
// the latest timeout event not happened yet
195+
if top_entry.time > now {
196+
return Some(top_entry.time - now);
203197
}
198+
199+
// find out one entry
204200
let entry = timer_bh.pop().unwrap();
205201
entry.list.in_use.store(0, Ordering::Release);
206202
entry

0 commit comments

Comments
 (0)