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() {
// 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"])

View File

@ -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! {

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 {
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));

View File

@ -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,

View File

@ -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<F: FnOnce(Vec<String>, Vec<String>)>(ids: Vec<S
}
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();
if tmp.len() != 2 {
bail!("Invalid server address: {}", rendezvous_server);

View File

@ -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()
};

View File

@ -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);
};
}

View File

@ -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,

View File

@ -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},

View File

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

View File

@ -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;