Skip to content

Commit 231aea4

Browse files
stephentoubCopilot
andcommitted
Fix Rust clippy warning
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 69deb49 commit 231aea4

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

rust/src/handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
//! [`on_event`](crate::handler::SessionHandler::on_event) to control how sessions respond to
55
//! CLI events, permission requests, tool calls, and user input prompts.
66
7+
use async_trait::async_trait;
8+
79
use crate::types::{
810
ElicitationRequest, ElicitationResult, PermissionRequestData, RequestId, SessionEvent,
911
SessionId, ToolInvocation, ToolResult,
1012
};
11-
use async_trait::async_trait;
1213

1314
/// Events dispatched by the SDK session event loop to the handler.
1415
///

rust/src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -927,15 +927,15 @@ impl Client {
927927
info!(path = %resolved.display(), "resolved copilot CLI");
928928
#[cfg(windows)]
929929
{
930-
if let Some(ext) = resolved.extension().and_then(|e| e.to_str()) {
931-
if ext.eq_ignore_ascii_case("cmd") || ext.eq_ignore_ascii_case("bat") {
932-
warn!(
933-
path = %resolved.display(),
934-
ext = %ext,
935-
"resolved copilot CLI is a .cmd/.bat wrapper; \
936-
this may cause console window flashes on Windows"
937-
);
938-
}
930+
if let Some(ext) = resolved.extension().and_then(|e| e.to_str()).filter(|ext| {
931+
ext.eq_ignore_ascii_case("cmd") || ext.eq_ignore_ascii_case("bat")
932+
}) {
933+
warn!(
934+
path = %resolved.display(),
935+
ext = %ext,
936+
"resolved copilot CLI is a .cmd/.bat wrapper; \
937+
this may cause console window flashes on Windows"
938+
);
939939
}
940940
}
941941
resolved

0 commit comments

Comments
 (0)