Skip to content

Commit 4742a81

Browse files
committed
Rename FileDescriptor to FileDescriptionRef
1 parent 724160a commit 4742a81

File tree

1 file changed

+8
-8
lines changed
  • src/tools/miri/src/shims/unix

1 file changed

+8
-8
lines changed

src/tools/miri/src/shims/unix/fd.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ impl FileDescription for NullOutput {
189189
}
190190

191191
#[derive(Clone, Debug)]
192-
pub struct FileDescriptor(Rc<RefCell<Box<dyn FileDescription>>>);
192+
pub struct FileDescriptionRef(Rc<RefCell<Box<dyn FileDescription>>>);
193193

194-
impl FileDescriptor {
194+
impl FileDescriptionRef {
195195
fn new(fd: impl FileDescription) -> Self {
196-
FileDescriptor(Rc::new(RefCell::new(Box::new(fd))))
196+
FileDescriptionRef(Rc::new(RefCell::new(Box::new(fd))))
197197
}
198198

199199
pub fn borrow(&self) -> Ref<'_, dyn FileDescription> {
@@ -217,7 +217,7 @@ impl FileDescriptor {
217217
/// The file descriptor table
218218
#[derive(Debug)]
219219
pub struct FdTable {
220-
fds: BTreeMap<i32, FileDescriptor>,
220+
fds: BTreeMap<i32, FileDescriptionRef>,
221221
}
222222

223223
impl VisitProvenance for FdTable {
@@ -245,12 +245,12 @@ impl FdTable {
245245

246246
/// Insert a new file description to the FdTable.
247247
pub fn insert_fd(&mut self, fd: impl FileDescription) -> i32 {
248-
let file_handle = FileDescriptor::new(fd);
248+
let file_handle = FileDescriptionRef::new(fd);
249249
self.insert_fd_with_min_fd(file_handle, 0)
250250
}
251251

252252
/// Insert a new FD that is at least `min_fd`.
253-
fn insert_fd_with_min_fd(&mut self, file_handle: FileDescriptor, min_fd: i32) -> i32 {
253+
fn insert_fd_with_min_fd(&mut self, file_handle: FileDescriptionRef, min_fd: i32) -> i32 {
254254
// Find the lowest unused FD, starting from min_fd. If the first such unused FD is in
255255
// between used FDs, the find_map combinator will return it. If the first such unused FD
256256
// is after all other used FDs, the find_map combinator will return None, and we will use
@@ -286,12 +286,12 @@ impl FdTable {
286286
Some(fd.borrow_mut())
287287
}
288288

289-
pub fn dup(&self, fd: i32) -> Option<FileDescriptor> {
289+
pub fn dup(&self, fd: i32) -> Option<FileDescriptionRef> {
290290
let fd = self.fds.get(&fd)?;
291291
Some(fd.clone())
292292
}
293293

294-
pub fn remove(&mut self, fd: i32) -> Option<FileDescriptor> {
294+
pub fn remove(&mut self, fd: i32) -> Option<FileDescriptionRef> {
295295
self.fds.remove(&fd)
296296
}
297297

0 commit comments

Comments
 (0)