Fix warning

This commit is contained in:
asur4s 2022-09-05 12:39:11 -04:00
parent 2d7cd7c864
commit b6e0cc8e74
9 changed files with 20 additions and 14 deletions

View File

@ -1,5 +1,4 @@
use crate::ResultType; use crate::ResultType;
use std::sync::Mutex;
pub fn get_display_server() -> String { pub fn get_display_server() -> String {
let session = get_value_of_seat0(0); let session = get_value_of_seat0(0);

View File

@ -276,6 +276,7 @@ impl<T: InvokeUi> Remote<T> {
} }
// TODO // TODO
#[allow(dead_code)]
fn load_last_jobs(&mut self) { fn load_last_jobs(&mut self) {
log::info!("start load last jobs"); log::info!("start load last jobs");
self.handler.clear_all_jobs(); self.handler.clear_all_jobs();

View File

@ -12,7 +12,9 @@ use crate::ui_session_interface::{io_loop, InvokeUi, Session};
use crate::{client::*, flutter_ffi::EventToUI}; use crate::{client::*, flutter_ffi::EventToUI};
pub(super) const APP_TYPE_MAIN: &str = "main"; pub(super) const APP_TYPE_MAIN: &str = "main";
#[allow(dead_code)]
pub(super) const APP_TYPE_DESKTOP_REMOTE: &str = "remote"; pub(super) const APP_TYPE_DESKTOP_REMOTE: &str = "remote";
#[allow(dead_code)]
pub(super) const APP_TYPE_DESKTOP_FILE_TRANSFER: &str = "file transfer"; pub(super) const APP_TYPE_DESKTOP_FILE_TRANSFER: &str = "file transfer";
lazy_static::lazy_static! { lazy_static::lazy_static! {
@ -117,7 +119,7 @@ impl InvokeUi for FlutterHandler {
); );
} }
fn job_error(&self, id: i32, err: String, file_num: i32) { fn job_error(&self, id: i32, err: String, _file_num: i32) {
self.push_event("job_error", vec![("id", &id.to_string()), ("err", &err)]); self.push_event("job_error", vec![("id", &id.to_string()), ("err", &err)]);
} }
@ -132,6 +134,7 @@ impl InvokeUi for FlutterHandler {
// todo!() // todo!()
} }
#[allow(unused_variables)]
fn add_job( fn add_job(
&self, &self,
id: i32, id: i32,
@ -148,6 +151,7 @@ impl InvokeUi for FlutterHandler {
// todo!() // todo!()
} }
#[allow(unused_variables)]
fn confirm_delete_files(&self, id: i32, i: i32, name: String) { fn confirm_delete_files(&self, id: i32, i: i32, name: String) {
// todo!() // todo!()
} }
@ -337,7 +341,7 @@ pub mod connection_manager {
protobuf::Message as _, protobuf::Message as _,
tokio::{ tokio::{
self, self,
sync::mpsc::{self, UnboundedReceiver, UnboundedSender}, sync::mpsc::{self, UnboundedSender},
task::spawn_blocking, task::spawn_blocking,
}, },
}; };
@ -432,7 +436,7 @@ pub mod connection_manager {
} }
Ok(Some(data)) => { Ok(Some(data)) => {
match data { match data {
Data::Login{id, is_file_transfer, port_forward, peer_id, name, authorized, keyboard, clipboard, audio, file, file_transfer_enabled, restart} => { Data::Login{id, is_file_transfer, port_forward, peer_id, name, authorized, keyboard, clipboard, audio, file, file_transfer_enabled: _file_transfer_enabled, restart} => {
log::debug!("conn_id: {}", id); log::debug!("conn_id: {}", id);
conn_id = id; conn_id = id;
// tx_file.send(ClipboardFileData::Enable((id, file_transfer_enabled))).ok(); // tx_file.send(ClipboardFileData::Enable((id, file_transfer_enabled))).ok();

View File

@ -106,9 +106,9 @@ pub fn stop_global_event_stream(app_type: String) {
.remove(&app_type); .remove(&app_type);
} }
pub fn host_stop_system_key_propagate(stopped: bool) { pub fn host_stop_system_key_propagate(_stopped: bool) {
#[cfg(windows)] #[cfg(windows)]
crate::platform::windows::stop_system_key_propagate(stopped); crate::platform::windows::stop_system_key_propagate(_stopped);
} }
// FIXME: -> ResultType<()> cannot be parsed by frb_codegen // FIXME: -> ResultType<()> cannot be parsed by frb_codegen
@ -388,7 +388,7 @@ pub fn session_create_dir(id: String, act_id: i32, path: String, is_remote: bool
} }
pub fn session_read_local_dir_sync(id: String, path: String, show_hidden: bool) -> String { pub fn session_read_local_dir_sync(id: String, path: String, show_hidden: bool) -> String {
if let Some(session) = SESSIONS.read().unwrap().get(&id) { if let Some(_) = SESSIONS.read().unwrap().get(&id) {
if let Ok(fd) = fs::read_dir(&fs::get_path(&path), show_hidden) { if let Ok(fd) = fs::read_dir(&fs::get_path(&path), show_hidden) {
return make_fd_to_json(fd); return make_fd_to_json(fd);
} }
@ -404,7 +404,7 @@ pub fn session_get_platform(id: String, is_remote: bool) -> String {
} }
pub fn session_load_last_transfer_jobs(id: String) { pub fn session_load_last_transfer_jobs(id: String) {
if let Some(session) = SESSIONS.read().unwrap().get(&id) { if let Some(_) = SESSIONS.read().unwrap().get(&id) {
// return session.load_last_jobs(); // return session.load_last_jobs();
} else { } else {
// a tip for flutter dev // a tip for flutter dev

View File

@ -568,6 +568,7 @@ pub fn get_mac() -> String {
"".to_owned() "".to_owned()
} }
#[allow(dead_code)]
fn lan_discovery() -> ResultType<()> { fn lan_discovery() -> ResultType<()> {
let addr = SocketAddr::from(([0, 0, 0, 0], get_broadcast_port())); let addr = SocketAddr::from(([0, 0, 0, 0], get_broadcast_port()));
let socket = std::net::UdpSocket::bind(addr)?; let socket = std::net::UdpSocket::bind(addr)?;
@ -637,7 +638,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 (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

@ -763,6 +763,7 @@ fn get_sound_inputs() -> Vec<String> {
.collect() .collect()
} }
#[allow(dead_code)]
fn check_connect_status( fn check_connect_status(
reconnect: bool, reconnect: bool,
) -> ( ) -> (

View File

@ -2,7 +2,6 @@ use std::{
collections::HashMap, collections::HashMap,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
sync::{ sync::{
atomic::{Ordering},
Arc, Mutex, Arc, Mutex,
}, },
}; };
@ -29,7 +28,7 @@ use hbb_common::{allow_err, log, message_proto::*, rendezvous_proto::ConnType};
use crate::clipboard_file::*; use crate::clipboard_file::*;
use crate::{ use crate::{
client::*, client::*,
ui_session_interface::{InvokeUi, Session, IS_IN}, ui_session_interface::{InvokeUi, Session},
}; };
type Video = AssetPtr<video_destination>; type Video = AssetPtr<video_destination>;
@ -155,6 +154,7 @@ impl InvokeUi for SciterHandler {
self.call("clearAllJobs", &make_args!()); self.call("clearAllJobs", &make_args!());
} }
#[allow(unused_variables)]
fn add_job( fn add_job(
&self, &self,
id: i32, id: i32,

View File

@ -69,7 +69,7 @@ pub fn goto_install() {
allow_err!(crate::run_me(vec!["--install"])); allow_err!(crate::run_me(vec!["--install"]));
} }
pub fn install_me(_options: String, _path: String, silent: bool, debug: bool) { pub fn install_me(_options: String, _path: String, _silent: bool, _debug: bool) {
#[cfg(windows)] #[cfg(windows)]
std::thread::spawn(move || { std::thread::spawn(move || {
allow_err!(crate::platform::windows::install_me( allow_err!(crate::platform::windows::install_me(
@ -682,6 +682,7 @@ pub fn check_super_user_permission() -> bool {
true true
} }
#[allow(dead_code)]
pub fn check_zombie(childs: Childs) { pub fn check_zombie(childs: Childs) {
let mut deads = Vec::new(); let mut deads = Vec::new();
loop { loop {

View File

@ -8,7 +8,6 @@ use crate::client::{
}; };
use crate::{client::Data, client::Interface}; use crate::{client::Data, client::Interface};
use async_trait::async_trait; use async_trait::async_trait;
use std::io::Read;
use hbb_common::config::{Config, LocalConfig, PeerConfig}; use hbb_common::config::{Config, LocalConfig, PeerConfig};
use hbb_common::rendezvous_proto::ConnType; use hbb_common::rendezvous_proto::ConnType;
use hbb_common::tokio::{self, sync::mpsc}; use hbb_common::tokio::{self, sync::mpsc};
@ -1157,7 +1156,7 @@ impl<T: InvokeUi> Session<T> {
return; return;
} }
log::info!("keyboard hooked"); log::info!("keyboard hooked");
let mut me = self.clone(); let me = self.clone();
#[cfg(windows)] #[cfg(windows)]
crate::platform::windows::enable_lowlevel_keyboard(std::ptr::null_mut() as _); crate::platform::windows::enable_lowlevel_keyboard(std::ptr::null_mut() as _);
std::thread::spawn(move || { std::thread::spawn(move || {