From ede06eeecfd787edbc17fba2afea164a87febd63 Mon Sep 17 00:00:00 2001 From: Tibor Schneider Date: Thu, 26 Sep 2024 13:47:53 +0200 Subject: [PATCH] Fix clippy warnings --- bgpsim-web/src/draw/canvas.rs | 2 +- bgpsim-web/src/sidebar/router_cfg/route_map_match_cfg.rs | 4 ++-- bgpsim/generate_topology_zoo.rs | 2 +- bgpsim/src/builder.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bgpsim-web/src/draw/canvas.rs b/bgpsim-web/src/draw/canvas.rs index fd94cc2..d69f29b 100644 --- a/bgpsim-web/src/draw/canvas.rs +++ b/bgpsim-web/src/draw/canvas.rs @@ -208,7 +208,7 @@ fn prepare_touch() -> (Callback, Callback) { n.dim.add_offset(delta); }); }; - } else if new_touches.len() > 1 { + } else { log::debug!("multi-touch not yet supported"); } *old_touches = new_touches; diff --git a/bgpsim-web/src/sidebar/router_cfg/route_map_match_cfg.rs b/bgpsim-web/src/sidebar/router_cfg/route_map_match_cfg.rs index 787e983..8024615 100644 --- a/bgpsim-web/src/sidebar/router_cfg/route_map_match_cfg.rs +++ b/bgpsim-web/src/sidebar/router_cfg/route_map_match_cfg.rs @@ -178,14 +178,14 @@ impl MatchValue { return Some(Self::Integer(x)); } if let Some(vs) = s - .split(|c| c == ',' || c == ';') + .split([',', ';']) .map(|x| Pfx::from_str(x.trim()).ok()) .collect::>>() { return Some(Self::PrefixList(vs)); } if let Some(vs) = s - .split(|c| c == ',' || c == ';') + .split([',', ';']) .map(|x| x.trim().parse::().ok()) .collect::>>() { diff --git a/bgpsim/generate_topology_zoo.rs b/bgpsim/generate_topology_zoo.rs index a1c937c..5a541fa 100644 --- a/bgpsim/generate_topology_zoo.rs +++ b/bgpsim/generate_topology_zoo.rs @@ -53,7 +53,7 @@ fn main() { } let topo_name = file_name.trim_end_matches(".graphml"); // check if all chars are ascii - if !topo_name.chars().all(|c| c.is_ascii()) { + if !topo_name.is_ascii() { continue; } // make sure the name only contains spaces, lowercase and uppercase letters, and starts diff --git a/bgpsim/src/builder.rs b/bgpsim/src/builder.rs index 1f3ee27..7633071 100644 --- a/bgpsim/src/builder.rs +++ b/bgpsim/src/builder.rs @@ -798,7 +798,7 @@ impl, Ospf: OspfImpl> NetworkBuilder // build a local LUT let lut: HashMap = self .external_indices() - .map(|ext| (ext, peer_type(ext, &self, a.clone()))) + .map(|ext| (ext, peer_type(ext, self, a.clone()))) .collect(); _build_gao_rexford(self, lut)