From a64c3b8515d67e4827a9817fa334985c27c4f770 Mon Sep 17 00:00:00 2001 From: Finesssee <90105158+Finesssee@users.noreply.github.com> Date: Sat, 22 Aug 2026 07:08:57 +0700 Subject: [PATCH 1/3] fix: satisfy Rust 1.98 chunk lint --- rust/src/codex_accounts/codex_desktop.rs | 2 +- rust/src/providers/cursor/app_auth.rs | 2 +- rust/src/providers/windsurf/mod.rs | 2 +- rust/src/tray/render.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/src/codex_accounts/codex_desktop.rs b/rust/src/codex_accounts/codex_desktop.rs index bcda25dfda..c9e4c36dff 100644 --- a/rust/src/codex_accounts/codex_desktop.rs +++ b/rust/src/codex_accounts/codex_desktop.rs @@ -382,7 +382,7 @@ mod tests { .decode(encoded) .unwrap(); let units: Vec = bytes - .chunks_exact(2) + .as_chunks::<2>().0.iter() .map(|chunk| u16::from_le_bytes([chunk[0], chunk[1]])) .collect(); let decoded = String::from_utf16(&units).unwrap(); diff --git a/rust/src/providers/cursor/app_auth.rs b/rust/src/providers/cursor/app_auth.rs index a123ebe68b..df71b0baa1 100644 --- a/rust/src/providers/cursor/app_auth.rs +++ b/rust/src/providers/cursor/app_auth.rs @@ -130,7 +130,7 @@ fn decode_utf16_le(bytes: &[u8]) -> Option { return None; } let units: Vec = bytes - .chunks_exact(2) + .as_chunks::<2>().0.iter() .map(|pair| u16::from_le_bytes([pair[0], pair[1]])) .collect(); String::from_utf16(&units).ok() diff --git a/rust/src/providers/windsurf/mod.rs b/rust/src/providers/windsurf/mod.rs index 88c9f5d5fb..5122942187 100644 --- a/rust/src/providers/windsurf/mod.rs +++ b/rust/src/providers/windsurf/mod.rs @@ -249,7 +249,7 @@ fn decode_json_blob(value: &[u8]) -> Option { if value.len().is_multiple_of(2) { let utf16: Vec = value - .chunks_exact(2) + .as_chunks::<2>().0.iter() .map(|chunk| u16::from_le_bytes([chunk[0], chunk[1]])) .collect(); if let Ok(text) = String::from_utf16(&utf16) diff --git a/rust/src/tray/render.rs b/rust/src/tray/render.rs index 88be614438..e5a262c629 100644 --- a/rust/src/tray/render.rs +++ b/rust/src/tray/render.rs @@ -232,7 +232,7 @@ mod tests { #[test] fn percent_icon_draws_visible_text() { let (rgba, _, _) = render_percent_icon_rgba(72.0, false); - assert!(rgba.chunks_exact(4).any(|px| px[3] == 255 && px[0] != 60)); + assert!(rgba.as_chunks::<4>().0.iter().any(|px| px[3] == 255 && px[0] != 60)); } #[test] From 6781a4008269c8f278deb97066b05de7f568f49a Mon Sep 17 00:00:00 2001 From: Finesssee <90105158+Finesssee@users.noreply.github.com> Date: Sat, 22 Aug 2026 07:14:10 +0700 Subject: [PATCH 2/3] style: format Rust chunk lint fix --- rust/src/codex_accounts/codex_desktop.rs | 4 +++- rust/src/providers/cursor/app_auth.rs | 4 +++- rust/src/providers/windsurf/mod.rs | 4 +++- rust/src/tray/render.rs | 7 ++++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/rust/src/codex_accounts/codex_desktop.rs b/rust/src/codex_accounts/codex_desktop.rs index c9e4c36dff..4c68488399 100644 --- a/rust/src/codex_accounts/codex_desktop.rs +++ b/rust/src/codex_accounts/codex_desktop.rs @@ -382,7 +382,9 @@ mod tests { .decode(encoded) .unwrap(); let units: Vec = bytes - .as_chunks::<2>().0.iter() + .as_chunks::<2>() + .0 + .iter() .map(|chunk| u16::from_le_bytes([chunk[0], chunk[1]])) .collect(); let decoded = String::from_utf16(&units).unwrap(); diff --git a/rust/src/providers/cursor/app_auth.rs b/rust/src/providers/cursor/app_auth.rs index df71b0baa1..5e195cad9b 100644 --- a/rust/src/providers/cursor/app_auth.rs +++ b/rust/src/providers/cursor/app_auth.rs @@ -130,7 +130,9 @@ fn decode_utf16_le(bytes: &[u8]) -> Option { return None; } let units: Vec = bytes - .as_chunks::<2>().0.iter() + .as_chunks::<2>() + .0 + .iter() .map(|pair| u16::from_le_bytes([pair[0], pair[1]])) .collect(); String::from_utf16(&units).ok() diff --git a/rust/src/providers/windsurf/mod.rs b/rust/src/providers/windsurf/mod.rs index 5122942187..eb4a2f798c 100644 --- a/rust/src/providers/windsurf/mod.rs +++ b/rust/src/providers/windsurf/mod.rs @@ -249,7 +249,9 @@ fn decode_json_blob(value: &[u8]) -> Option { if value.len().is_multiple_of(2) { let utf16: Vec = value - .as_chunks::<2>().0.iter() + .as_chunks::<2>() + .0 + .iter() .map(|chunk| u16::from_le_bytes([chunk[0], chunk[1]])) .collect(); if let Ok(text) = String::from_utf16(&utf16) diff --git a/rust/src/tray/render.rs b/rust/src/tray/render.rs index e5a262c629..2af6ec4c7c 100644 --- a/rust/src/tray/render.rs +++ b/rust/src/tray/render.rs @@ -232,7 +232,12 @@ mod tests { #[test] fn percent_icon_draws_visible_text() { let (rgba, _, _) = render_percent_icon_rgba(72.0, false); - assert!(rgba.as_chunks::<4>().0.iter().any(|px| px[3] == 255 && px[0] != 60)); + assert!( + rgba.as_chunks::<4>() + .0 + .iter() + .any(|px| px[3] == 255 && px[0] != 60) + ); } #[test] From 3377c597a69f81872f66b2d4d683fa599c0d1949 Mon Sep 17 00:00:00 2001 From: Finesssee <90105158+Finesssee@users.noreply.github.com> Date: Sat, 22 Aug 2026 07:24:32 +0700 Subject: [PATCH 3/3] test: make Pi dedup fixture time-independent --- rust/src/pi_session_cost.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/src/pi_session_cost.rs b/rust/src/pi_session_cost.rs index 66313ef0ba..ff02d05660 100644 --- a/rust/src/pi_session_cost.rs +++ b/rust/src/pi_session_cost.rs @@ -379,7 +379,9 @@ mod tests { for name in ["a.jsonl", "b.jsonl"] { total += for_each_pi_entry( &sessions.join(name), - Utc::now() - Duration::days(30), + DateTime::parse_from_rfc3339("2026-07-01T00:00:00Z") + .unwrap() + .with_timezone(&Utc), PiMappedProvider::Codex, &mut seen, |entry| apply_entry(&mut summary, &entry),