diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-02 01:32:03 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-02 01:34:49 +0900 |
| commit | eab3a31c5750013c53c0eb02adc976d6757dc9f7 (patch) | |
| tree | c84b4bc6243668eb79c00af98e00800c2951077b /crates/shirabe-php-shim/src/xml.rs | |
| parent | dda045eb663524b40e277047e3cea301738e5c26 (diff) | |
| download | php-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/xml.rs')
| -rw-r--r-- | crates/shirabe-php-shim/src/xml.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/shirabe-php-shim/src/xml.rs b/crates/shirabe-php-shim/src/xml.rs index cc323ca..b3938da 100644 --- a/crates/shirabe-php-shim/src/xml.rs +++ b/crates/shirabe-php-shim/src/xml.rs @@ -5,7 +5,6 @@ //! handles over that graph. use std::cell::RefCell; -use std::io::Write; use std::rc::{Rc, Weak}; #[derive(Debug, Clone, Copy, PartialEq)] @@ -120,7 +119,7 @@ impl DOMDocument { self.0.borrow_mut().format_output = value; } - pub fn save_xml<W: Write>(&self, writer: &mut W) -> std::io::Result<()> { + pub fn save_xml<W: std::io::Write>(&self, writer: &mut W) -> std::io::Result<()> { let doc = self.0.borrow(); writeln!( writer, @@ -250,7 +249,7 @@ fn collect_by_tag( } } -fn serialize_node<W: Write>( +fn serialize_node<W: std::io::Write>( node: &Rc<RefCell<NodeInner>>, depth: usize, format: bool, @@ -305,14 +304,14 @@ fn serialize_node<W: Write>( Ok(()) } -fn write_indent<W: Write>(out: &mut W, depth: usize) -> std::io::Result<()> { +fn write_indent<W: std::io::Write>(out: &mut W, depth: usize) -> std::io::Result<()> { for _ in 0..depth { out.write_all(b" ")?; } Ok(()) } -fn escape_text<W: Write>(s: &str, out: &mut W) -> std::io::Result<()> { +fn escape_text<W: std::io::Write>(s: &str, out: &mut W) -> std::io::Result<()> { let mut buf = [0u8; 4]; for c in s.chars() { match c { @@ -326,7 +325,7 @@ fn escape_text<W: Write>(s: &str, out: &mut W) -> std::io::Result<()> { Ok(()) } -fn escape_attribute<W: Write>(s: &str, out: &mut W) -> std::io::Result<()> { +fn escape_attribute<W: std::io::Write>(s: &str, out: &mut W) -> std::io::Result<()> { let mut buf = [0u8; 4]; for c in s.chars() { match c { |
