Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy lint warnings. #118

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/device/gpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,18 @@

/// Send a request to the device and block for a response.
fn request<Req: AsBytes, Rsp: FromBytes>(&mut self, req: Req) -> Result<Rsp> {
req.write_to_prefix(&mut *self.queue_buf_send).unwrap();
req.write_to_prefix(&mut self.queue_buf_send).unwrap();
self.control_queue.add_notify_wait_pop(
&[&self.queue_buf_send],
&mut [&mut self.queue_buf_recv],
&mut self.transport,
)?;
Ok(Rsp::read_from_prefix(&*self.queue_buf_recv).unwrap())
Ok(Rsp::read_from_prefix(&self.queue_buf_recv).unwrap())
}

/// Send a mouse cursor operation request to the device and block for a response.
fn cursor_request<Req: AsBytes>(&mut self, req: Req) -> Result {
req.write_to_prefix(&mut *self.queue_buf_send).unwrap();
req.write_to_prefix(&mut self.queue_buf_send).unwrap();
self.cursor_queue.add_notify_wait_pop(
&[&self.queue_buf_send],
&mut [],
Expand Down Expand Up @@ -255,16 +255,16 @@
rsp.check_type(Command::OK_NODATA)
}

fn update_cursor(
&mut self,
resource_id: u32,
scanout_id: u32,
pos_x: u32,
pos_y: u32,
hot_x: u32,
hot_y: u32,
is_move: bool,
) -> Result {

Check warning on line 267 in src/device/gpu.rs

View workflow job for this annotation

GitHub Actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7) --> src/device/gpu.rs:258:5 | 258 | / fn update_cursor( 259 | | &mut self, 260 | | resource_id: u32, 261 | | scanout_id: u32, ... | 266 | | is_move: bool, 267 | | ) -> Result { | |_______________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
self.cursor_request(UpdateCursor {
header: if is_move {
CtrlHeader::with_type(Command::MOVE_CURSOR)
Expand Down
Loading