diff --git a/fish-rust/src/fds.rs b/fish-rust/src/fds.rs index ea9406bf8..b0c157fa7 100644 --- a/fish-rust/src/fds.rs +++ b/fish-rust/src/fds.rs @@ -139,7 +139,7 @@ impl Drop for AutoCloseFd { /// Helper type returned from make_autoclose_pipes. #[derive(Default)] -pub struct autoclose_pipes_t { +pub struct AutoClosePipes { /// Read end of the pipe. pub read: AutoCloseFd, @@ -149,7 +149,7 @@ pub struct autoclose_pipes_t { /// Construct a pair of connected pipes, set to close-on-exec. /// \return None on fd exhaustion. -pub fn make_autoclose_pipes() -> Option { +pub fn make_autoclose_pipes() -> Option { let pipes = ffi::make_pipes_ffi(); let readp = AutoCloseFd::new(pipes.read); @@ -157,7 +157,7 @@ pub fn make_autoclose_pipes() -> Option { if !readp.is_valid() || !writep.is_valid() { None } else { - Some(autoclose_pipes_t { + Some(AutoClosePipes { read: readp, write: writep, }) diff --git a/fish-rust/src/topic_monitor.rs b/fish-rust/src/topic_monitor.rs index f4d53a0b8..d2d6ae23e 100644 --- a/fish-rust/src/topic_monitor.rs +++ b/fish-rust/src/topic_monitor.rs @@ -21,7 +21,7 @@ set. This is the real power of topics: you can wait for a sigchld signal OR a th */ use crate::fd_readable_set::fd_readable_set_t; -use crate::fds::{self, autoclose_pipes_t}; +use crate::fds::{self, AutoClosePipes}; use crate::ffi::{self as ffi, c_int}; use crate::flog::{FloggableDebug, FLOG}; use crate::wchar::{widestrs, wstr, WString}; @@ -184,7 +184,7 @@ pub struct binary_semaphore_t { sem_: Pin>>, // Pipes used to emulate a semaphore, if not initialized. - pipes_: autoclose_pipes_t, + pipes_: AutoClosePipes, } impl binary_semaphore_t { @@ -194,7 +194,7 @@ impl binary_semaphore_t { // sem_t does not have an initializer in Rust so we use zeroed(). #[allow(unused_mut)] let mut sem_ = Pin::from(Box::new(UnsafeCell::new(unsafe { mem::zeroed() }))); - let mut pipes_ = autoclose_pipes_t::default(); + let mut pipes_ = AutoClosePipes::default(); // sem_init always fails with ENOSYS on Mac and has an annoying deprecation warning. // On BSD sem_init uses a file descriptor under the hood which doesn't get CLOEXEC (see #7304). // So use fast semaphores on Linux only.