diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-16 00:59:54 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-16 01:03:45 +0900 |
| commit | 3a388b98a9aa6a14b1c7f7dc909c109cf9837800 (patch) | |
| tree | 593e342313c6e6bd3ec2943a1690b8798e0a83ae /crates/shirabe-php-shim/src/lib.rs | |
| parent | aad468e8b75ffc3e87ea6dfa22c53a8299fc08da (diff) | |
| download | php-shirabe-3a388b98a9aa6a14b1c7f7dc909c109cf9837800.tar.gz php-shirabe-3a388b98a9aa6a14b1c7f7dc909c109cf9837800.tar.zst php-shirabe-3a388b98a9aa6a14b1c7f7dc909c109cf9837800.zip | |
refactor: narrow pub(crate) items to private
Porting mapped every PHP `protected` member onto `pub(crate)`, which is
wider than nearly all of them need. Each item demoted here is reached
only from the module that defines it, so the crate-wide visibility
conveyed nothing.
Every `pub(crate)` that survives has at least one reader in another
module of the same crate.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src/lib.rs')
| -rw-r--r-- | crates/shirabe-php-shim/src/lib.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index 63e4226e..b9613053 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -402,7 +402,7 @@ impl PhpResource { /// Returns the underlying OS file descriptor backing this resource, when it has one. /// Used by `stream_set_blocking`/`stream_select` to drive `fcntl(2)`/`select(2)`. In-memory /// streams (`php://memory`/`php://temp`) and process handles have no fd and return `None`. - pub(crate) fn raw_fd(&self) -> Option<std::os::unix::io::RawFd> { + fn raw_fd(&self) -> Option<std::os::unix::io::RawFd> { use std::os::unix::io::AsRawFd; match self { PhpResource::Stdin => Some(std::io::stdin().as_raw_fd()), @@ -442,7 +442,7 @@ pub enum StreamBacking { } impl StreamBacking { - pub(crate) fn as_rws(&mut self) -> &mut dyn ReadWriteSeek { + fn as_rws(&mut self) -> &mut dyn ReadWriteSeek { match self { StreamBacking::File(f) => f, StreamBacking::Memory(c) => c, @@ -515,23 +515,23 @@ impl std::os::unix::io::AsRawFd for ChildPipe { #[derive(Debug)] pub struct StreamState { - pub(crate) backing: StreamBacking, + backing: StreamBacking, /// Whether the mode opened the stream for reading. - pub(crate) readable: bool, + readable: bool, /// Whether the mode opened the stream for writing. - pub(crate) writable: bool, + writable: bool, /// Set once a read attempt sees end-of-stream, mirroring PHP's `feof()` which /// only reports true after a read has hit the end; cleared by a seek. - pub(crate) eof: bool, - pub(crate) closed: bool, + eof: bool, + closed: bool, /// The mode string passed to `fopen`, reported back by `stream_get_meta_data`. - pub(crate) mode: String, + mode: String, /// The path/URI the stream was opened from, reported back by `stream_get_meta_data`. - pub(crate) uri: String, + uri: String, } impl StreamState { - pub(crate) fn new( + fn new( backing: StreamBacking, readable: bool, writable: bool, |
