@@ -189,11 +189,11 @@ impl FileDescription for NullOutput {
189
189
}
190
190
191
191
#[ derive( Clone , Debug ) ]
192
- pub struct FileDescriptor ( Rc < RefCell < Box < dyn FileDescription > > > ) ;
192
+ pub struct FileDescriptionRef ( Rc < RefCell < Box < dyn FileDescription > > > ) ;
193
193
194
- impl FileDescriptor {
194
+ impl FileDescriptionRef {
195
195
fn new ( fd : impl FileDescription ) -> Self {
196
- FileDescriptor ( Rc :: new ( RefCell :: new ( Box :: new ( fd) ) ) )
196
+ FileDescriptionRef ( Rc :: new ( RefCell :: new ( Box :: new ( fd) ) ) )
197
197
}
198
198
199
199
pub fn borrow ( & self ) -> Ref < ' _ , dyn FileDescription > {
@@ -217,7 +217,7 @@ impl FileDescriptor {
217
217
/// The file descriptor table
218
218
#[ derive( Debug ) ]
219
219
pub struct FdTable {
220
- fds : BTreeMap < i32 , FileDescriptor > ,
220
+ fds : BTreeMap < i32 , FileDescriptionRef > ,
221
221
}
222
222
223
223
impl VisitProvenance for FdTable {
@@ -245,12 +245,12 @@ impl FdTable {
245
245
246
246
/// Insert a new file description to the FdTable.
247
247
pub fn insert_fd ( & mut self , fd : impl FileDescription ) -> i32 {
248
- let file_handle = FileDescriptor :: new ( fd) ;
248
+ let file_handle = FileDescriptionRef :: new ( fd) ;
249
249
self . insert_fd_with_min_fd ( file_handle, 0 )
250
250
}
251
251
252
252
/// 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 {
254
254
// Find the lowest unused FD, starting from min_fd. If the first such unused FD is in
255
255
// between used FDs, the find_map combinator will return it. If the first such unused FD
256
256
// is after all other used FDs, the find_map combinator will return None, and we will use
@@ -286,12 +286,12 @@ impl FdTable {
286
286
Some ( fd. borrow_mut ( ) )
287
287
}
288
288
289
- pub fn dup ( & self , fd : i32 ) -> Option < FileDescriptor > {
289
+ pub fn dup ( & self , fd : i32 ) -> Option < FileDescriptionRef > {
290
290
let fd = self . fds . get ( & fd) ?;
291
291
Some ( fd. clone ( ) )
292
292
}
293
293
294
- pub fn remove ( & mut self , fd : i32 ) -> Option < FileDescriptor > {
294
+ pub fn remove ( & mut self , fd : i32 ) -> Option < FileDescriptionRef > {
295
295
self . fds . remove ( & fd)
296
296
}
297
297
0 commit comments