From 4a48e0e954b7afda55ff0419e091790b5b7b9f64 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 16 Aug 2026 09:15:26 +0900 Subject: refactor(io): take &str in ConsoleIO write and sanitize doWrite, doOverwrite and sanitize accept PHP's string|list, which this port modelled as PhpMixed. Every call site inside ConsoleIO passes a single string, so take &str and return String instead, dropping the (array) casts and the to_string_list helper. Auditor is the only caller that passed a list: it builds table rows, whose cells must stay separate, so it now sanitizes each cell. select() likewise sanitizes each choice while projecting them into the keyed form. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/tests/io/console_io_test.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/tests/io/console_io_test.rs') diff --git a/crates/shirabe/tests/io/console_io_test.rs b/crates/shirabe/tests/io/console_io_test.rs index b0c6380d..e6b19c05 100644 --- a/crates/shirabe/tests/io/console_io_test.rs +++ b/crates/shirabe/tests/io/console_io_test.rs @@ -291,11 +291,11 @@ fn test_has_authentication() { assert!(!console_io.has_authentication("repoName2")); } -#[ignore = "data provider includes malformed-UTF-8 inputs (e.g. \\xFF, \\xC3\\x28); sanitize() takes PhpMixed::String which is UTF-8-only and cannot carry invalid bytes, so those cases are unrepresentable"] +#[ignore = "data provider includes malformed-UTF-8 inputs (e.g. \\xFF, \\xC3\\x28); sanitize() takes a &str which is UTF-8-only and cannot carry invalid bytes, so those cases are unrepresentable"] #[test] fn test_sanitize() { // TODO(bytes): the data provider includes malformed-UTF-8 inputs (e.g. \xFF, \xC3\x28); - // sanitize() takes PhpMixed::String which is UTF-8-only and cannot carry invalid bytes, so - // those cases are unrepresentable. + // sanitize() takes a &str which is UTF-8-only and cannot carry invalid bytes, so those cases + // are unrepresentable. todo!() } -- cgit v1.3.1-4-g156e