aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src/stream.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-02 01:32:03 +0900
committernsfisis <nsfisis@gmail.com>2026-07-02 01:34:49 +0900
commiteab3a31c5750013c53c0eb02adc976d6757dc9f7 (patch)
treec84b4bc6243668eb79c00af98e00800c2951077b /crates/shirabe-php-shim/src/stream.rs
parentdda045eb663524b40e277047e3cea301738e5c26 (diff)
downloadphp-shirabe-eab3a31c5750013c53c0eb02adc976d6757dc9f7.tar.gz
php-shirabe-eab3a31c5750013c53c0eb02adc976d6757dc9f7.tar.zst
php-shirabe-eab3a31c5750013c53c0eb02adc976d6757dc9f7.zip
chore(lint): ban std::io::Read/Write, Any, Command use imports
Extends no_banned_use to cover std::any::Any, std::io::Read/Write, and std::process::Command, and teaches the linter to allow `as _` imports so trait methods can still be brought into scope without binding the banned name. Fully qualifies all existing usages across the codebase.
Diffstat (limited to 'crates/shirabe-php-shim/src/stream.rs')
-rw-r--r--crates/shirabe-php-shim/src/stream.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/shirabe-php-shim/src/stream.rs b/crates/shirabe-php-shim/src/stream.rs
index 98f0322..ce6048c 100644
--- a/crates/shirabe-php-shim/src/stream.rs
+++ b/crates/shirabe-php-shim/src/stream.rs
@@ -1,5 +1,6 @@
use crate::{PhpMixed, PhpResource, StreamBacking};
use indexmap::IndexMap;
+use std::io::{Read as _, Write as _};
pub const STREAM_NOTIFY_FAILURE: i64 = 9;
pub const STREAM_NOTIFY_FILE_SIZE_IS: i64 = 5;
@@ -30,7 +31,6 @@ pub fn stream_get_contents_with_max(
// Reads from the stream's current position: all remaining bytes, or up to `max_length` when given
// (a negative max means "until end").
fn stream_read_remaining(stream: &PhpResource, max_length: Option<i64>) -> Option<String> {
- use std::io::Read;
match stream {
PhpResource::Stdin => {
let mut buf = Vec::new();
@@ -139,7 +139,6 @@ pub fn stream_get_wrappers() -> Vec<String> {
/// PHP `stream_copy_to_stream()`: copy the remaining bytes of `source` into `dest`, returning the
/// number of bytes copied (or `None` for `false`-on-failure).
pub fn stream_copy_to_stream(source: &PhpResource, dest: &PhpResource) -> Option<i64> {
- use std::io::{Read, Write};
let mut buf = Vec::new();
match source {
PhpResource::Stdin => {