]> git.lizzy.rs Git - rust.git/commitdiff
Replace last_entry with last_key_value
authorStein Somers <git@steinsomers.be>
Sun, 5 Apr 2020 13:21:15 +0000 (15:21 +0200)
committerStein Somers <git@steinsomers.be>
Sun, 5 Apr 2020 13:21:15 +0000 (15:21 +0200)
src/shims/fs.rs

index 52244dcfc847e31494d1e4dbded68fe4ba91bb16..c70cc874164f1da4a9faf165405fe8586703c63f 100644 (file)
@@ -56,7 +56,7 @@ fn insert_fd_with_min_fd(&mut self, file_handle: FileHandle, min_fd: i32) -> i32
         let new_fd = candidate_new_fd.unwrap_or_else(|| {
             // find_map ran out of BTreeMap entries before finding a free fd, use one plus the
             // maximum fd in the map
-            self.handles.last_entry().map(|entry| entry.key().checked_add(1).unwrap()).unwrap_or(min_fd)
+            self.handles.last_key_value().map(|(fd, _)| fd.checked_add(1).unwrap()).unwrap_or(min_fd)
         });
 
         self.handles.insert(new_fd, file_handle).unwrap_none();