style(agent): clear 77 pre-existing clippy -D warnings
All checks were successful
All checks were successful
CI never ran clippy on the agent crate (the build-server clippy job is Linux-only and can't compile the Windows agent; build-agent only runs cargo build), so 77 clippy -D-warnings errors had accumulated. Behavior-preserving cleanup, code-reviewed APPROVED, locally verified (cargo clippy --workspace --all-targets --all-features -- -D warnings exits 0; cargo test --workspace = 57 passed). - let _ = on Win32 resource-teardown BOOL returns (gdi.rs); fallible BitBlt/GetDIBits stay error-handled - removed unused imports/vars; idiom fixes (div_ceil, is_null, transmute annotations, match collapsing, useless_conversion) - #[allow(dead_code)] + comment on genuine Task-6/7 scaffolding (vk consts, SpecialKey emission, SAS mgmt API, modifier tracking, GDI frame-diff fields) - Cargo.lock: cargo pruned ~147 stale transitive entries (no version changes) Follow-up: add cargo clippy -D warnings to the build-agent CI job so the agent crate stays clippy-clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,8 +5,7 @@ use anyhow::Result;
|
||||
#[cfg(windows)]
|
||||
use windows::Win32::UI::Input::KeyboardAndMouse::{
|
||||
MapVirtualKeyW, SendInput, INPUT, INPUT_0, INPUT_KEYBOARD, KEYBDINPUT, KEYBD_EVENT_FLAGS,
|
||||
KEYEVENTF_EXTENDEDKEY, KEYEVENTF_KEYUP, KEYEVENTF_SCANCODE, KEYEVENTF_UNICODE,
|
||||
MAPVK_VK_TO_VSC_EX,
|
||||
KEYEVENTF_EXTENDEDKEY, KEYEVENTF_KEYUP, KEYEVENTF_UNICODE, MAPVK_VK_TO_VSC_EX,
|
||||
};
|
||||
|
||||
/// Keyboard input controller
|
||||
@@ -16,6 +15,8 @@ pub struct KeyboardController {
|
||||
modifiers: ModifierState,
|
||||
}
|
||||
|
||||
// Modifier tracking is not yet wired into key dispatch.
|
||||
#[allow(dead_code)]
|
||||
#[derive(Default)]
|
||||
struct ModifierState {
|
||||
ctrl: bool,
|
||||
@@ -78,6 +79,7 @@ impl KeyboardController {
|
||||
}
|
||||
|
||||
/// Type a unicode character
|
||||
#[allow(dead_code)]
|
||||
#[cfg(windows)]
|
||||
pub fn type_char(&mut self, ch: char) -> Result<()> {
|
||||
let mut inputs = Vec::new();
|
||||
@@ -119,6 +121,7 @@ impl KeyboardController {
|
||||
}
|
||||
|
||||
/// Type a string of text
|
||||
#[allow(dead_code)]
|
||||
#[cfg(windows)]
|
||||
pub fn type_string(&mut self, text: &str) -> Result<()> {
|
||||
for ch in text.chars() {
|
||||
|
||||
@@ -26,11 +26,13 @@ impl InputController {
|
||||
}
|
||||
|
||||
/// Get mouse controller
|
||||
#[allow(dead_code)]
|
||||
pub fn mouse(&mut self) -> &mut MouseController {
|
||||
&mut self.mouse
|
||||
}
|
||||
|
||||
/// Get keyboard controller
|
||||
#[allow(dead_code)]
|
||||
pub fn keyboard(&mut self) -> &mut KeyboardController {
|
||||
&mut self.keyboard
|
||||
}
|
||||
@@ -64,6 +66,7 @@ impl InputController {
|
||||
}
|
||||
|
||||
/// Type a unicode character
|
||||
#[allow(dead_code)]
|
||||
pub fn type_unicode(&mut self, ch: char) -> Result<()> {
|
||||
self.keyboard.type_char(ch)
|
||||
}
|
||||
@@ -80,7 +83,10 @@ pub enum MouseButton {
|
||||
Left,
|
||||
Right,
|
||||
Middle,
|
||||
// Extra mouse buttons; not yet produced by the viewer input mapping.
|
||||
#[allow(dead_code)]
|
||||
X1,
|
||||
#[allow(dead_code)]
|
||||
X2,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user