diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-07-29 11:47:49 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-07-29 11:47:49 +0000 |
| commit | 4742a81ebd787022a579ae7d8a8dca23fa78147e (patch) | |
| tree | 884007552dc7ce83ba807f1c5ceb442cebdc2078 | |
| parent | 724160ae3da68839032f6869dc9cb1aeb3e04a2d (diff) | |
| download | rust-4742a81ebd787022a579ae7d8a8dca23fa78147e.tar.gz rust-4742a81ebd787022a579ae7d8a8dca23fa78147e.zip | |
Rename `FileDescriptor` to `FileDescriptionRef`
| -rw-r--r-- | src/tools/miri/src/shims/unix/fd.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/miri/src/shims/unix/fd.rs b/src/tools/miri/src/shims/unix/fd.rs index 85ff9f1fc63..323b7371d47 100644 --- a/src/tools/miri/src/shims/unix/fd.rs +++ b/src/tools/miri/src/shims/unix/fd.rs @@ -189,11 +189,11 @@ impl FileDescription for NullOutput { } #[derive(Clone, Debug)] -pub struct FileDescriptor(Rc<RefCell<Box<dyn FileDescription>>>); +pub struct FileDescriptionRef(Rc<RefCell<Box<dyn FileDescription>>>); -impl FileDescriptor { +impl FileDescriptionRef { fn new(fd: impl FileDescription) -> Self { - FileDescriptor(Rc::new(RefCell::new(Box::new(fd)))) + FileDescriptionRef(Rc::new(RefCell::new(Box::new(fd)))) } pub fn borrow(&self) -> Ref<'_, dyn FileDescription> { @@ -217,7 +217,7 @@ impl FileDescriptor { /// The file descriptor table #[derive(Debug)] pub struct FdTable { - fds: BTreeMap<i32, FileDescriptor>, + fds: BTreeMap<i32, FileDescriptionRef>, } impl VisitProvenance for FdTable { @@ -245,12 +245,12 @@ impl FdTable { /// Insert a new file description to the FdTable. pub fn insert_fd(&mut self, fd: impl FileDescription) -> i32 { - let file_handle = FileDescriptor::new(fd); + let file_handle = FileDescriptionRef::new(fd); self.insert_fd_with_min_fd(file_handle, 0) } /// Insert a new FD that is at least `min_fd`. - fn insert_fd_with_min_fd(&mut self, file_handle: FileDescriptor, min_fd: i32) -> i32 { + fn insert_fd_with_min_fd(&mut self, file_handle: FileDescriptionRef, min_fd: i32) -> i32 { // Find the lowest unused FD, starting from min_fd. If the first such unused FD is in // between used FDs, the find_map combinator will return it. If the first such unused FD // is after all other used FDs, the find_map combinator will return None, and we will use @@ -286,12 +286,12 @@ impl FdTable { Some(fd.borrow_mut()) } - pub fn dup(&self, fd: i32) -> Option<FileDescriptor> { + pub fn dup(&self, fd: i32) -> Option<FileDescriptionRef> { let fd = self.fds.get(&fd)?; Some(fd.clone()) } - pub fn remove(&mut self, fd: i32) -> Option<FileDescriptor> { + pub fn remove(&mut self, fd: i32) -> Option<FileDescriptionRef> { self.fds.remove(&fd) } |
