{"record":{"id":"89e6b69a5a75c001","repo":"Hmbown/CodeWhale","slug":"serializing-a-rust-string-cannot-fail","errorCode":null,"errorMessage":"serializing a Rust string cannot fail","messagePattern":"serializing a Rust string cannot fail","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/commands/groups/plugins/render.rs","lineNumber":238,"sourceCode":"                && candidate\n                    .canonicalize()\n                    .is_ok_and(|path| path.starts_with(&plugin.canonical_root))\n            {\n                return format!(\n                    \"#{position} plugin-path={}\",\n                    render_review_argv_value(argument)\n                );\n            }\n            format!(\"#{position} value={}\", render_review_argv_value(argument))\n        })\n        .collect()\n}\n\nfn render_review_argv_value(value: &str) -> String {\n    // JSON string syntax is a lossless, unambiguous terminal representation:\n    // whitespace, quotes, backslashes, and punctuation retain their exact\n    // argv semantics without hiding arbitrary values behind redaction.\n    serde_json::to_string(value).expect(\"serializing a Rust string cannot fail\")\n}\n\nfn render_review_values(values: &[String]) -> String {\n    if values.is_empty() {\n        return \"none\".to_string();\n    }\n    values\n        .iter()\n        .map(|value| escape_review_text(value))\n        .collect::<Vec<_>>()\n        .join(\", \")\n}\n\nfn render_mcp_timeouts(server: &crate::mcp::McpServerConfig) -> String {\n    format!(\n        \"connect={}/execute={}/read={}\",\n        server\n            .connect_timeout","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/commands/groups/plugins/render.rs#L220-L256","documentation":"render_review_argv_value() serializes a &str with serde_json and unwraps: serializing a Rust string into a JSON string is infallible (no I/O, no custom serializers). The expect documents that invariant; firing would indicate a serde_json bug or a changed serializer setup.","triggerScenarios":"Thrown at crates/tui/src/commands/groups/plugins/render.rs:238 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm serde_json::to_string is still used on a plain &str","If the value type changes to something fallible, propagate the error instead of expecting"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}