diff --git a/build.rs b/build.rs index 5ed40b001..d9b7a5516 100644 --- a/build.rs +++ b/build.rs @@ -78,8 +78,6 @@ fn install_oboe() { fn gen_flutter_rust_bridge() { // Get dependent of flutter - println!("cargo:rerun-if-changed=flutter/pubspec.lock"); - println!("cargo:rerun-if-changed=flutter/pubspec.yaml"); if !std::path::Path::new("./flutter/.packages").exists(){ std::process::Command::new("flutter") .args(["pub", "get"]) diff --git a/src/client.rs b/src/client.rs index e47667f72..2bc60765a 100644 --- a/src/client.rs +++ b/src/client.rs @@ -61,7 +61,6 @@ pub struct Client; lazy_static::lazy_static! { static ref AUDIO_HOST: Host = cpal::default_host(); } -use rdev::{Event, EventType::*, Key as RdevKey, Keyboard as RdevKeyboard, KeyboardState}; #[cfg(not(any(target_os = "android", target_os = "ios")))] lazy_static::lazy_static! { diff --git a/src/common.rs b/src/common.rs index 5c387c07e..81adebb0a 100644 --- a/src/common.rs +++ b/src/common.rs @@ -668,7 +668,6 @@ pub fn make_privacy_mode_msg(state: back_notification::PrivacyModeState) -> Mess } pub fn make_fd_to_json(fd: FileDirectory) -> String { - use serde_json::json; let mut fd_json = serde_json::Map::new(); fd_json.insert("id".into(), json!(fd.id)); fd_json.insert("path".into(), json!(fd.path)); diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index bc1335970..78f53bf89 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -5,13 +5,13 @@ use std::{ }; use flutter_rust_bridge::{StreamSink, SyncReturn, ZeroCopyBuffer}; -use serde_json::{json, Number, Value}; +use serde_json::json; use hbb_common::{ - config::{self, Config, LocalConfig, PeerConfig, ONLINE}, + config::{self, LocalConfig, PeerConfig, ONLINE}, fs, log, }; -use hbb_common::{password_security, ResultType}; +use hbb_common::{ResultType}; use crate::{client::file_trait::FileManager, flutter::{session_add, session_start_}}; use crate::common::make_fd_to_json; @@ -20,7 +20,7 @@ use crate::flutter::{self, SESSIONS}; use crate::start_server; use crate::ui_interface; #[cfg(not(any(target_os = "android", target_os = "ios")))] -use crate::ui_interface::{change_id, check_connect_status, is_ok_change_id}; +use crate::ui_interface::{change_id}; use crate::ui_interface::{ check_mouse_time, check_super_user_permission, discover, forget_password, get_api_server, get_app_name, get_async_job_status, get_connect_status, get_fav, get_id, get_lan_peers, diff --git a/src/rendezvous_mediator.rs b/src/rendezvous_mediator.rs index 08a1316f0..802fed1de 100644 --- a/src/rendezvous_mediator.rs +++ b/src/rendezvous_mediator.rs @@ -1,4 +1,3 @@ -use std::collections::HashMap; use std::{ net::SocketAddr, sync::{ @@ -10,12 +9,10 @@ use std::{ use uuid::Uuid; -use hbb_common::config::DiscoveryPeer; use hbb_common::tcp::FramedStream; use hbb_common::{ allow_err, anyhow::bail, - config, config::{Config, REG_INTERVAL, RENDEZVOUS_PORT, RENDEZVOUS_TIMEOUT}, futures::future::join_all, log, @@ -640,7 +637,7 @@ pub async fn query_online_states, Vec)>(ids: Vec ResultType { - let (mut rendezvous_server, servers, contained) = crate::get_rendezvous_server(1_000).await; + let (mut rendezvous_server, _servers, _contained) = crate::get_rendezvous_server(1_000).await; let tmp: Vec<&str> = rendezvous_server.split(":").collect(); if tmp.len() != 2 { bail!("Invalid server address: {}", rendezvous_server); diff --git a/src/server/connection.rs b/src/server/connection.rs index e71b32e35..d93d6d775 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -633,7 +633,7 @@ impl Connection { let mut pi = PeerInfo { username: username.clone(), conn_id: self.inner.id, - version: crate::VERSION.to_owned(), + version: VERSION.to_owned(), ..Default::default() }; diff --git a/src/server/input_service.rs b/src/server/input_service.rs index b72370d12..e0707bded 100644 --- a/src/server/input_service.rs +++ b/src/server/input_service.rs @@ -673,12 +673,12 @@ fn tfc_key_down_or_up(key: Key, down: bool, up: bool) { if let Key::Layout(chr) = key { log::info!("tfc_key_down_or_up :{:?}", chr); if down { - if let Err(e) = TFC_CONTEXT.lock().unwrap().unicode_char_down(chr){ + if let Err(_) = TFC_CONTEXT.lock().unwrap().unicode_char_down(chr){ log::error!("Failed to press char {:?}", chr); }; } if up { - if let Err(e) = TFC_CONTEXT.lock().unwrap().unicode_char_down(chr){ + if let Err(_) = TFC_CONTEXT.lock().unwrap().unicode_char_down(chr){ log::error!("Failed to press char {:?}",chr); }; } @@ -753,12 +753,12 @@ fn tfc_key_down_or_up(key: Key, down: bool, up: bool) { log::info!("tfc_key_down_or_up: {:?}", key); if down { - if let Err(e) = TFC_CONTEXT.lock().unwrap().key_down(key){ + if let Err(_) = TFC_CONTEXT.lock().unwrap().key_down(key){ log::error!("Failed to press char {:?}", key); }; } if up { - if let Err(e) = TFC_CONTEXT.lock().unwrap().key_up(key){ + if let Err(_) = TFC_CONTEXT.lock().unwrap().key_up(key){ log::error!("Failed to press char {:?}", key); }; } diff --git a/src/ui.rs b/src/ui.rs index b66d1453b..0e754e622 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -9,7 +9,7 @@ use sciter::Value; use hbb_common::{ allow_err, - config::{self, Config, LocalConfig, PeerConfig, RENDEZVOUS_PORT, RENDEZVOUS_TIMEOUT}, + config::{self, Config, PeerConfig, RENDEZVOUS_PORT, RENDEZVOUS_TIMEOUT}, futures::future::join_all, log, protobuf::Message as _, @@ -19,7 +19,7 @@ use hbb_common::{ tokio::{self, sync::mpsc, time}, }; -use crate::common::{get_app_name, SOFTWARE_UPDATE_URL}; +use crate::common::{get_app_name}; use crate::ipc; use crate::ui_interface::{ check_mouse_time, closing, create_shortcut, current_is_wayland, fix_login_wayland, diff --git a/src/ui/cm.rs b/src/ui/cm.rs index 3200d51b4..bef0ee3bd 100644 --- a/src/ui/cm.rs +++ b/src/ui/cm.rs @@ -6,13 +6,13 @@ use clipboard::{ create_cliprdr_context, empty_clipboard, get_rx_clip_client, server_clip_file, set_conn_enabled, }; use hbb_common::fs::{ - can_enable_overwrite_detection, get_string, is_write_need_confirmation, new_send_confirm, + get_string, is_write_need_confirmation, new_send_confirm, DigestCheckResult, }; use hbb_common::{ allow_err, config::Config, - fs, get_version_number, log, + fs, log, message_proto::*, protobuf::Message as _, tokio::{self, sync::mpsc, task::spawn_blocking}, diff --git a/src/ui/remote.rs b/src/ui/remote.rs index 91dd08fdc..093ad901e 100644 --- a/src/ui/remote.rs +++ b/src/ui/remote.rs @@ -2,7 +2,7 @@ use std::{ collections::HashMap, ops::{Deref, DerefMut}, sync::{ - atomic::{AtomicBool, Ordering}, + atomic::{Ordering}, Arc, Mutex, }, }; diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index 33949a116..4f5ec55b8 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -6,7 +6,6 @@ use crate::client::{ load_config, send_mouse, start_video_audio_threads, FileManager, Key, LoginConfigHandler, QualityStatus, KEY_MAP, SERVER_KEYBOARD_ENABLED, }; -use crate::common; use crate::{client::Data, client::Interface}; use async_trait::async_trait;