File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -422,7 +422,6 @@ impl Window {
422422 self . request ( FrontendRequest :: SetMdnsDiscovery ( enabled) ) ;
423423 }
424424
425-
426425 fn open_fingerprint_dialog ( & self , fp : Option < String > ) {
427426 let window = FingerprintWindow :: new ( fp) ;
428427 window. set_transient_for ( Some ( self ) ) ;
@@ -491,7 +490,6 @@ impl Window {
491490 }
492491 }
493492
494-
495493 pub ( super ) fn set_release_threshold ( & self , threshold : u32 ) {
496494 let imp = self . imp ( ) ;
497495 // Block the value-changed handler so programmatically setting
Original file line number Diff line number Diff line change @@ -538,7 +538,6 @@ impl Config {
538538 self . config_toml . as_mut ( ) . expect ( "config" ) . mdns_discovery = Some ( enabled) ;
539539 }
540540
541-
542541 /// set configured clients
543542 pub fn set_clients ( & mut self , clients : Vec < ConfigClient > ) {
544543 if clients. is_empty ( ) {
Original file line number Diff line number Diff line change @@ -277,6 +277,7 @@ impl LanMouseConnection {
277277 /// - the candidate-set signature has changed since the last
278278 /// attempt (new IP from DNS, or new mDNS primary), or
279279 /// - the recorded backoff has elapsed.
280+ ///
280281 /// Otherwise returns false; the caller treats this as "still in
281282 /// cooldown, keep returning NotConnected silently."
282283 fn should_attempt ( & self , handle : ClientHandle ) -> bool {
@@ -300,6 +301,7 @@ impl LanMouseConnection {
300301 }
301302}
302303
304+ #[ allow( clippy:: too_many_arguments) ]
303305async fn connect_to_handle (
304306 client_manager : ClientManager ,
305307 cert : Certificate ,
Original file line number Diff line number Diff line change @@ -280,10 +280,8 @@ impl Discovery {
280280 /// need to take the same Rc reference.
281281 #[ allow( dead_code) ]
282282 pub ( crate ) fn peer_primary_ip ( & self , hostname : & str ) -> Option < IpAddr > {
283- if self . daemon . is_none ( ) {
284- return None ;
285- }
286- let key = strip_trailing_dot ( hostname) . to_ascii_lowercase ( ) ;
283+ self . daemon . as_ref ( ) ?;
284+ let key = normalize_mdns_name ( hostname) ;
287285 self . primary_cache . borrow ( ) . get ( & key) . copied ( )
288286 }
289287}
@@ -312,8 +310,7 @@ fn start_browse(
312310 while let Ok ( event) = receiver. recv_async ( ) . await {
313311 match event {
314312 ServiceEvent :: ServiceResolved ( resolved) => {
315- let Some ( primary_str) = resolved. get_property_val_str ( TXT_PRIMARY_KEY )
316- else {
313+ let Some ( primary_str) = resolved. get_property_val_str ( TXT_PRIMARY_KEY ) else {
317314 continue ;
318315 } ;
319316 let Ok ( ip) = primary_str. parse :: < IpAddr > ( ) else {
@@ -323,8 +320,7 @@ fn start_browse(
323320 ) ;
324321 continue ;
325322 } ;
326- let instance =
327- instance_from_fullname ( resolved. get_fullname ( ) , SERVICE_TYPE ) ;
323+ let instance = instance_from_fullname ( resolved. get_fullname ( ) , SERVICE_TYPE ) ;
328324 let key = normalize_mdns_name ( instance) ;
329325 let target = strip_trailing_dot ( resolved. get_hostname ( ) ) ;
330326 log:: info!(
Original file line number Diff line number Diff line change @@ -105,11 +105,8 @@ impl Service {
105105 let listener =
106106 LanMouseListener :: new ( config. port ( ) , cert. clone ( ) , authorized_keys. clone ( ) ) . await ?;
107107 let primary_cache: PrimaryCache = Default :: default ( ) ;
108- let conn = LanMouseConnection :: new (
109- cert. clone ( ) ,
110- client_manager. clone ( ) ,
111- primary_cache. clone ( ) ,
112- ) ;
108+ let conn =
109+ LanMouseConnection :: new ( cert. clone ( ) , client_manager. clone ( ) , primary_cache. clone ( ) ) ;
113110
114111 // input capture + emulation
115112 let capture_backend = config. capture_backend ( ) . map ( |b| b. into ( ) ) ;
@@ -168,8 +165,7 @@ impl Service {
168165 // off Wi-Fi and Mac falls back to Ethernet. Cheap: at most
169166 // one re-publish every 30s, and a no-op when the primary
170167 // hasn't moved.
171- let mut discovery_refresh_tick =
172- tokio:: time:: interval ( Duration :: from_secs ( 30 ) ) ;
168+ let mut discovery_refresh_tick = tokio:: time:: interval ( Duration :: from_secs ( 30 ) ) ;
173169 // skip the immediate-fire of the first tick — Discovery
174170 // already published once at startup
175171 discovery_refresh_tick. tick ( ) . await ;
You can’t perform that action at this time.
0 commit comments