chore: senior-review cleanup pass
- Remove Gemini's committed update_*.py regex-surgery scripts - Drop unused iroh-tickets dependency (hand-rolled ticket is used instead) - Replace ToString antipattern with Display impl on PeerSpeakTicket - Route debug log to XDG state/cache dir instead of hardcoded /home path - Clear all compiler + clippy warnings (unused imports, collapsible ifs, redundant pattern matching, missing Default) Builds clean with zero warnings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+10
-5
@@ -42,11 +42,16 @@ pub struct PeerSpeakTicket {
|
||||
pub topic_id: [u8; 32],
|
||||
}
|
||||
|
||||
impl ToString for PeerSpeakTicket {
|
||||
fn to_string(&self) -> String {
|
||||
let serialized = serde_json::to_vec(self).unwrap();
|
||||
// Convert to base64 URL-safe string
|
||||
base64::Engine::encode(&base64::engine::general_purpose::URL_SAFE_NO_PAD, &serialized)
|
||||
impl std::fmt::Display for PeerSpeakTicket {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
// serde_json on a struct of String/[u8;32] fields is infallible in practice,
|
||||
// but Display can't surface an error, so fall back to an empty ticket body.
|
||||
let serialized = serde_json::to_vec(self).unwrap_or_default();
|
||||
let encoded = base64::Engine::encode(
|
||||
&base64::engine::general_purpose::URL_SAFE_NO_PAD,
|
||||
&serialized,
|
||||
);
|
||||
f.write_str(&encoded)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user