Skip to content

Commit e7fafa1

Browse files
committed
Replace last_entry with last_key_value
1 parent b1f0537 commit e7fafa1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shims/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl FileHandler {
5656
let new_fd = candidate_new_fd.unwrap_or_else(|| {
5757
// find_map ran out of BTreeMap entries before finding a free fd, use one plus the
5858
// maximum fd in the map
59-
self.handles.last_entry().map(|entry| entry.key().checked_add(1).unwrap()).unwrap_or(min_fd)
59+
self.handles.last_key_value().map(|(fd, _)| fd.checked_add(1).unwrap()).unwrap_or(min_fd)
6060
});
6161

6262
self.handles.insert(new_fd, file_handle).unwrap_none();

0 commit comments

Comments
 (0)