fix(codex-rs): clean dev-fast build warnings

- Remove unnecessary mut on Browser values; keep handler mutable
- Drop unused locals in chatwidget; underscore elapsed in history_cell
- Silence dead_code for ShowChromeOptions variant

Verified via ./build-fast.sh showing zero warnings.
This commit is contained in:
James Peter
2025-08-17 18:55:58 +10:00
parent 71f7266369
commit bb408f34ac
4 changed files with 7 additions and 10 deletions
+4 -4
View File
@@ -224,7 +224,7 @@ impl BrowserManager {
let ws_clone = ws.clone();
let handle = tokio::spawn(async move { Browser::connect(ws_clone).await });
match tokio::time::timeout(attempt_timeout, handle).await {
Ok(Ok(Ok((mut browser, mut handler)))) => {
Ok(Ok(Ok((browser, mut handler)))) => {
info!("[cdp/bm] WS connect attempt {} succeeded", attempt);
// Start event handler loop
@@ -338,7 +338,7 @@ impl BrowserManager {
let handle = tokio::spawn(async move { Browser::connect(ws_clone).await });
match tokio::time::timeout(attempt_timeout, handle).await {
Ok(Ok(Ok((mut browser, mut handler)))) => {
Ok(Ok(Ok((browser, mut handler)))) => {
info!("[cdp/bm] WS connect attempt {} succeeded", attempt);
info!("[cdp/bm] Connected to Chrome in {:?}", connect_start.elapsed());
@@ -435,7 +435,7 @@ impl BrowserManager {
let ws_clone = ws.clone();
let handle = tokio::spawn(async move { Browser::connect(ws_clone).await });
match tokio::time::timeout(attempt_timeout, handle).await {
Ok(Ok(Ok((mut browser, mut handler)))) => {
Ok(Ok(Ok((browser, mut handler)))) => {
info!("[cdp/bm] WS connect attempt {} succeeded", attempt);
// Start event handler loop
let task = tokio::spawn(async move { while let Some(_evt) = handler.next().await {} });
@@ -546,7 +546,7 @@ impl BrowserManager {
let ws_clone = ws.clone();
let handle = tokio::spawn(async move { Browser::connect(ws_clone).await });
match tokio::time::timeout(attempt_timeout, handle).await {
Ok(Ok(Ok((mut browser, mut handler)))) => {
Ok(Ok(Ok((browser, mut handler)))) => {
info!("[cdp/bm] WS connect attempt {} succeeded", attempt);
info!(
"Step 4: Connected to Chrome in {:?}",
+1
View File
@@ -92,6 +92,7 @@ pub(crate) enum AppEvent {
OnboardingComplete(ChatWidgetArgs),
/// Show Chrome launch options dialog
#[allow(dead_code)]
ShowChromeOptions(Option<u16>),
/// Chrome launch option selected by user
+1 -5
View File
@@ -3481,7 +3481,6 @@ impl ChatWidget<'_> {
let latest_screenshot = self.latest_browser_screenshot.clone();
let app_event_tx = self.app_event_tx.clone();
let port_display = port.map_or("auto-detect".to_string(), |p| p.to_string());
let launch_port = port.unwrap_or(9222);
// Add status message to chat
let status_msg = format!(
@@ -4304,10 +4303,7 @@ impl WidgetRef for &ChatWidget<'_> {
let mut welcome_overlay: Option<&dyn HistoryCell> = None;
// Add all history cells
for (idx, cell) in self.history_cells.iter().enumerate() {
let is_animating = cell.is_animating();
let has_custom = cell.has_custom_render();
let height = cell.desired_height(content_area.width);
for cell in self.history_cells.iter() {
// suppress noisy per-cell animation logs
// If this is the animated welcome cell, render it as an overlay instead
+1 -1
View File
@@ -375,7 +375,7 @@ impl HistoryCell for AnimatedWelcomeCell {
}
fn custom_render(&self, area: Rect, buf: &mut Buffer) {
let elapsed = self.start_time.elapsed();
let _elapsed = self.start_time.elapsed();
// Center the animation within the provided area
// The actual animation needs 21 rows