Skip to content

Commit

Permalink
chore: fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nazo6 committed Jan 3, 2025
1 parent 133cd64 commit 2e7566c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/rktk-drivers-common/src/usb/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use usbd_hid::descriptor::{
KeyboardReport, MediaKeyboardReport, MouseReport, SerializedDescriptor as _,
};

use crate::usb::handler::{UsbDeviceHandler, UsbRequestHandler};
use crate::usb::handler::UsbDeviceHandler;

use super::driver::CommonUsbDriver;
use super::{task::*, ReadySignal};
Expand Down
12 changes: 6 additions & 6 deletions lib/rktk-drivers-common/src/usb/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl UsbDeviceHandler {

// 参考: https://www.itf.co.jp/tech/road-to-usb-master/usb-status
impl Handler for UsbDeviceHandler {
fn enabled(&mut self, enabled: bool) {
fn enabled(&mut self, _enabled: bool) {
self.configured.store(false, Ordering::Relaxed);
SUSPENDED.store(false, Ordering::Release);
}
Expand All @@ -30,7 +30,7 @@ impl Handler for UsbDeviceHandler {
self.configured.store(false, Ordering::Relaxed);
}

fn addressed(&mut self, addr: u8) {
fn addressed(&mut self, _addr: u8) {
self.configured.store(false, Ordering::Relaxed);
}

Expand All @@ -50,17 +50,17 @@ impl Handler for UsbDeviceHandler {
pub struct UsbRequestHandler {}

impl RequestHandler for UsbRequestHandler {
fn get_report(&mut self, id: ReportId, _buf: &mut [u8]) -> Option<usize> {
fn get_report(&mut self, _id: ReportId, _buf: &mut [u8]) -> Option<usize> {
None
}

fn set_report(&mut self, id: ReportId, data: &[u8]) -> OutResponse {
fn set_report(&mut self, _id: ReportId, _data: &[u8]) -> OutResponse {
OutResponse::Accepted
}

fn set_idle_ms(&mut self, id: Option<ReportId>, dur: u32) {}
fn set_idle_ms(&mut self, _id: Option<ReportId>, _dur: u32) {}

fn get_idle_ms(&mut self, id: Option<ReportId>) -> Option<u32> {
fn get_idle_ms(&mut self, _id: Option<ReportId>) -> Option<u32> {
None
}
}
4 changes: 2 additions & 2 deletions lib/rktk-drivers-nrf/src/split/uart_full_duplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<'d, I: UarteInstance, T: TimerInstance> UartFullDuplexSplitDriver<'d, I, T>
impl<I: UarteInstance, T: TimerInstance> SplitDriver for UartFullDuplexSplitDriver<'_, I, T> {
type Error = UartFullDuplexSplitDriverError;

async fn wait_recv(&mut self, buf: &mut [u8], is_master: bool) -> Result<(), Self::Error> {
async fn wait_recv(&mut self, buf: &mut [u8], _is_master: bool) -> Result<(), Self::Error> {
let mut i = 0;
loop {
let mut byte = [0];
Expand All @@ -42,7 +42,7 @@ impl<I: UarteInstance, T: TimerInstance> SplitDriver for UartFullDuplexSplitDriv
Ok(())
}

async fn send(&mut self, buf: &[u8], is_master: bool) -> Result<(), Self::Error> {
async fn send(&mut self, buf: &[u8], _is_master: bool) -> Result<(), Self::Error> {
self.uarte
.write_all(buf)
.await
Expand Down
3 changes: 2 additions & 1 deletion tools/rktk-client/src/app/components/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::time::Duration;

use dioxus::prelude::*;

#[allow(dead_code)]
#[derive(Default)]
pub enum NotificationLevel {
#[default]
Expand Down Expand Up @@ -35,7 +36,7 @@ struct NotificationData {
record: Notification,
}

static NOTFICATIONS: GlobalSignal<Vec<NotificationData>> = GlobalSignal::new(|| vec![]);
static NOTFICATIONS: GlobalSignal<Vec<NotificationData>> = GlobalSignal::new(Vec::new);
static NOTIFICATION_ID: GlobalSignal<usize> = GlobalSignal::new(|| 0);

pub fn push_notification(notification: Notification) {
Expand Down

0 comments on commit 2e7566c

Please sign in to comment.