From 657440d01423b50153d07ebc288d9bd2fc982d52 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 21 Jun 2026 16:31:44 +0900 Subject: refactor(json): eliminate json_last_error in favor of Result json_encode/json_encode_ex now return anyhow::Result instead of Option, so callers no longer need json_last_error() to get the failure reason. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/io/base_io.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/shirabe/src/io/base_io.rs') diff --git a/crates/shirabe/src/io/base_io.rs b/crates/shirabe/src/io/base_io.rs index 99c3d70..79fd7b7 100644 --- a/crates/shirabe/src/io/base_io.rs +++ b/crates/shirabe/src/io/base_io.rs @@ -451,7 +451,8 @@ pub trait BaseIO: IOInterface { Ok(json_encode_ex( &PhpMixed::Array(log_context(context)), JSON_INVALID_UTF8_IGNORE | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE, - )) + ) + .ok()) }); if let Ok(Some(json_str)) = json { message_str += " "; -- cgit v1.3.1