From e774210ae34bbf5545a3f094761ebed33bcabbad Mon Sep 17 00:00:00 2001 From: mofeng-git Date: Mon, 18 May 2026 15:23:42 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=B9=B6=E6=B8=85=E7=90=86=E6=9C=AA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/audio/capture_linux.rs | 2 +- src/hid/otg.rs | 4 +++- src/hid/otg_device.rs | 8 ++------ src/web/handlers/msd_api.rs | 6 ++++++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/audio/capture_linux.rs b/src/audio/capture_linux.rs index 14a3510b..89aaca03 100644 --- a/src/audio/capture_linux.rs +++ b/src/audio/capture_linux.rs @@ -7,7 +7,7 @@ use std::time::Instant; use tokio::sync::{broadcast, watch, Mutex}; use tracing::{debug, info}; -use super::device::AudioDeviceInfo; +use crate::audio::device::AudioDeviceInfo; use crate::error::{AppError, Result}; use crate::utils::LogThrottler; use crate::{error_throttled, warn_throttled}; diff --git a/src/hid/otg.rs b/src/hid/otg.rs index f2eb3b81..e3b9e5e8 100644 --- a/src/hid/otg.rs +++ b/src/hid/otg.rs @@ -6,13 +6,15 @@ use async_trait::async_trait; use parking_lot::Mutex; use std::fs::{self, File, OpenOptions}; -use std::io::{Read, Write}; +use std::io::Read; +use std::os::fd::AsFd; use std::os::unix::fs::OpenOptionsExt; use std::path::PathBuf; use std::sync::atomic::{AtomicBool, AtomicU8, Ordering}; use std::sync::Arc; use std::thread; use std::time::Duration; +use nix::poll::{poll, PollFd, PollFlags, PollTimeout}; use tokio::sync::watch; use tracing::{debug, info, trace, warn}; diff --git a/src/hid/otg_device.rs b/src/hid/otg_device.rs index d9307f42..9d47a689 100644 --- a/src/hid/otg_device.rs +++ b/src/hid/otg_device.rs @@ -1,13 +1,9 @@ #[cfg(unix)] -use std::fs::{File, OpenOptions}; +use std::fs::File; #[cfg(unix)] -use std::io::{Read, Write}; -#[cfg(unix)] -use std::os::unix::fs::OpenOptionsExt; +use std::io::Write; #[cfg(unix)] use std::os::unix::io::AsFd; -#[cfg(unix)] -use std::path::PathBuf; #[cfg(unix)] use nix::poll::{poll, PollFd, PollFlags, PollTimeout}; diff --git a/src/web/handlers/msd_api.rs b/src/web/handlers/msd_api.rs index 464a6940..430a0b23 100644 --- a/src/web/handlers/msd_api.rs +++ b/src/web/handlers/msd_api.rs @@ -5,8 +5,14 @@ use crate::msd::{ ImageManager, MsdConnectRequest, MsdMode, MsdState, VentoyDrive, }; #[cfg(unix)] +use axum::body::Body; +#[cfg(unix)] use axum::extract::{Multipart, Path as AxumPath}; #[cfg(unix)] +use axum::http::{header, StatusCode}; +#[cfg(unix)] +use axum::response::Response; +#[cfg(unix)] use std::collections::HashMap; /// MSD status response