Fix compile warning

This commit is contained in:
Asura 2022-09-02 01:20:48 -07:00
parent 03315a3bc4
commit 41241867b7
11 changed files with 15 additions and 23 deletions

View File

@ -78,8 +78,6 @@ fn install_oboe() {
fn gen_flutter_rust_bridge() { fn gen_flutter_rust_bridge() {
// Get dependent of flutter // 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(){ if !std::path::Path::new("./flutter/.packages").exists(){
std::process::Command::new("flutter") std::process::Command::new("flutter")
.args(["pub", "get"]) .args(["pub", "get"])

View File

@ -61,7 +61,6 @@ pub struct Client;
lazy_static::lazy_static! { lazy_static::lazy_static! {
static ref AUDIO_HOST: Host = cpal::default_host(); 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")))] #[cfg(not(any(target_os = "android", target_os = "ios")))]
lazy_static::lazy_static! { lazy_static::lazy_static! {

View File

@ -668,7 +668,6 @@ pub fn make_privacy_mode_msg(state: back_notification::PrivacyModeState) -> Mess
} }
pub fn make_fd_to_json(fd: FileDirectory) -> String { pub fn make_fd_to_json(fd: FileDirectory) -> String {
use serde_json::json;
let mut fd_json = serde_json::Map::new(); let mut fd_json = serde_json::Map::new();
fd_json.insert("id".into(), json!(fd.id)); fd_json.insert("id".into(), json!(fd.id));
fd_json.insert("path".into(), json!(fd.path)); fd_json.insert("path".into(), json!(fd.path));

View File

@ -5,13 +5,13 @@ use std::{
}; };
use flutter_rust_bridge::{StreamSink, SyncReturn, ZeroCopyBuffer}; use flutter_rust_bridge::{StreamSink, SyncReturn, ZeroCopyBuffer};
use serde_json::{json, Number, Value}; use serde_json::json;
use hbb_common::{ use hbb_common::{
config::{self, Config, LocalConfig, PeerConfig, ONLINE}, config::{self, LocalConfig, PeerConfig, ONLINE},
fs, log, 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::{client::file_trait::FileManager, flutter::{session_add, session_start_}};
use crate::common::make_fd_to_json; use crate::common::make_fd_to_json;
@ -20,7 +20,7 @@ use crate::flutter::{self, SESSIONS};
use crate::start_server; use crate::start_server;
use crate::ui_interface; use crate::ui_interface;
#[cfg(not(any(target_os = "android", target_os = "ios")))] #[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::{ use crate::ui_interface::{
check_mouse_time, check_super_user_permission, discover, forget_password, get_api_server, 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, get_app_name, get_async_job_status, get_connect_status, get_fav, get_id, get_lan_peers,

View File

@ -1,4 +1,3 @@
use std::collections::HashMap;
use std::{ use std::{
net::SocketAddr, net::SocketAddr,
sync::{ sync::{
@ -10,12 +9,10 @@ use std::{
use uuid::Uuid; use uuid::Uuid;
use hbb_common::config::DiscoveryPeer;
use hbb_common::tcp::FramedStream; use hbb_common::tcp::FramedStream;
use hbb_common::{ use hbb_common::{
allow_err, allow_err,
anyhow::bail, anyhow::bail,
config,
config::{Config, REG_INTERVAL, RENDEZVOUS_PORT, RENDEZVOUS_TIMEOUT}, config::{Config, REG_INTERVAL, RENDEZVOUS_PORT, RENDEZVOUS_TIMEOUT},
futures::future::join_all, futures::future::join_all,
log, log,
@ -640,7 +637,7 @@ pub async fn query_online_states<F: FnOnce(Vec<String>, Vec<String>)>(ids: Vec<S
} }
async fn create_online_stream() -> ResultType<FramedStream> { async fn create_online_stream() -> ResultType<FramedStream> {
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(); let tmp: Vec<&str> = rendezvous_server.split(":").collect();
if tmp.len() != 2 { if tmp.len() != 2 {
bail!("Invalid server address: {}", rendezvous_server); bail!("Invalid server address: {}", rendezvous_server);

View File

@ -633,7 +633,7 @@ impl Connection {
let mut pi = PeerInfo { let mut pi = PeerInfo {
username: username.clone(), username: username.clone(),
conn_id: self.inner.id, conn_id: self.inner.id,
version: crate::VERSION.to_owned(), version: VERSION.to_owned(),
..Default::default() ..Default::default()
}; };

View File

@ -673,12 +673,12 @@ fn tfc_key_down_or_up(key: Key, down: bool, up: bool) {
if let Key::Layout(chr) = key { if let Key::Layout(chr) = key {
log::info!("tfc_key_down_or_up :{:?}", chr); log::info!("tfc_key_down_or_up :{:?}", chr);
if down { 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); log::error!("Failed to press char {:?}", chr);
}; };
} }
if up { 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); 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); log::info!("tfc_key_down_or_up: {:?}", key);
if down { 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); log::error!("Failed to press char {:?}", key);
}; };
} }
if up { 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); log::error!("Failed to press char {:?}", key);
}; };
} }

View File

@ -9,7 +9,7 @@ use sciter::Value;
use hbb_common::{ use hbb_common::{
allow_err, allow_err,
config::{self, Config, LocalConfig, PeerConfig, RENDEZVOUS_PORT, RENDEZVOUS_TIMEOUT}, config::{self, Config, PeerConfig, RENDEZVOUS_PORT, RENDEZVOUS_TIMEOUT},
futures::future::join_all, futures::future::join_all,
log, log,
protobuf::Message as _, protobuf::Message as _,
@ -19,7 +19,7 @@ use hbb_common::{
tokio::{self, sync::mpsc, time}, 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::ipc;
use crate::ui_interface::{ use crate::ui_interface::{
check_mouse_time, closing, create_shortcut, current_is_wayland, fix_login_wayland, check_mouse_time, closing, create_shortcut, current_is_wayland, fix_login_wayland,

View File

@ -6,13 +6,13 @@ use clipboard::{
create_cliprdr_context, empty_clipboard, get_rx_clip_client, server_clip_file, set_conn_enabled, create_cliprdr_context, empty_clipboard, get_rx_clip_client, server_clip_file, set_conn_enabled,
}; };
use hbb_common::fs::{ 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, DigestCheckResult,
}; };
use hbb_common::{ use hbb_common::{
allow_err, allow_err,
config::Config, config::Config,
fs, get_version_number, log, fs, log,
message_proto::*, message_proto::*,
protobuf::Message as _, protobuf::Message as _,
tokio::{self, sync::mpsc, task::spawn_blocking}, tokio::{self, sync::mpsc, task::spawn_blocking},

View File

@ -2,7 +2,7 @@ use std::{
collections::HashMap, collections::HashMap,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
sync::{ sync::{
atomic::{AtomicBool, Ordering}, atomic::{Ordering},
Arc, Mutex, Arc, Mutex,
}, },
}; };

View File

@ -6,7 +6,6 @@ use crate::client::{
load_config, send_mouse, start_video_audio_threads, FileManager, Key, LoginConfigHandler, load_config, send_mouse, start_video_audio_threads, FileManager, Key, LoginConfigHandler,
QualityStatus, KEY_MAP, SERVER_KEYBOARD_ENABLED, QualityStatus, KEY_MAP, SERVER_KEYBOARD_ENABLED,
}; };
use crate::common;
use crate::{client::Data, client::Interface}; use crate::{client::Data, client::Interface};
use async_trait::async_trait; use async_trait::async_trait;