diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-02 05:42:23 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-02 05:42:23 +0900 |
| commit | 73911c5da18cd37761f90a15558d76d5742f38e5 (patch) | |
| tree | a508fd247ac2b8c509e86486056464b59b3eaf21 /crates/shirabe-php-shim/src/string.rs | |
| parent | f6767e4fd477cf0a66017f5ff2783aa919beac86 (diff) | |
| download | php-shirabe-73911c5da18cd37761f90a15558d76d5742f38e5.tar.gz php-shirabe-73911c5da18cd37761f90a15558d76d5742f38e5.tar.zst php-shirabe-73911c5da18cd37761f90a15558d76d5742f38e5.zip | |
refactor(php-shim): replace sprintf todo!() with an unsupported panic
%e/%E/%g/%G never appear in Composer's own format strings (verified by
sweeping composer/src and vendor); supporting PHP's exponent formatting
is intentionally out of scope, so fail permanently instead of marking
the specifiers as pending work.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src/string.rs')
| -rw-r--r-- | crates/shirabe-php-shim/src/string.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/shirabe-php-shim/src/string.rs b/crates/shirabe-php-shim/src/string.rs index 8a96a8c3..9563d614 100644 --- a/crates/shirabe-php-shim/src/string.rs +++ b/crates/shirabe-php-shim/src/string.rs @@ -876,10 +876,11 @@ pub fn sprintf(_format: &str, _args: &[PhpMixed]) -> String { } (s, false) } - // TODO(phase-d): %e/%E/%g/%G are not ported; their exponent formatting differs from - // Rust's default float formatting and an exact PHP match has not been implemented. - b'e' | b'E' | b'g' | b'G' => todo!("sprintf conversion %{}", spec as char), - _ => todo!("sprintf conversion %{}", spec as char), + // Intentionally unsupported: no Composer format string uses these, and PHP's + // exponent formatting differs from Rust's default float formatting. + _ => { + panic!("Unsupported sprintf() format specifier: %{}", spec as char) + } }; out.push_str(&sprintf_pad(core, width, left, pad, numeric)); |
