From 14376071253d9791fdb4e54fda394ffca0f62f97 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 23 Mar 2026 13:11:40 -0600 Subject: [PATCH 1/4] chore(config): deny clippy::redundant_closure_for_method_calls Remove `#![allow(clippy::redundant_closure_for_method_calls)]` and replace all redundant closures with method references throughout the config crate. I actually don't love this particular change because I thought it was fine before. That said, I hate having arguments with the linter a lot more. Co-authored-by: Claude Opus 4.6 Signed-off-by: Daniel Noland --- .../src/converters/k8s/status/dataplane_status.rs | 2 +- config/src/display.rs | 2 +- config/src/external/gwgroup.rs | 2 +- config/src/external/overlay/vpcpeering.rs | 14 ++++++++++---- config/src/external/underlay/mod.rs | 2 +- config/src/internal/device/tracecfg.rs | 2 +- config/src/lib.rs | 1 - 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/config/src/converters/k8s/status/dataplane_status.rs b/config/src/converters/k8s/status/dataplane_status.rs index 78d404dec..e6ab7375c 100644 --- a/config/src/converters/k8s/status/dataplane_status.rs +++ b/config/src/converters/k8s/status/dataplane_status.rs @@ -136,7 +136,7 @@ mod tests { let last_applied_time = time_gen.generate(d)?; let status = d .produce::>>()? - .map(|v| v.take()); + .map(LegalValue::take); let last_collected_time_raw = time_gen.generate(d)?; let last_collected_time = status.as_ref().map(|_| last_collected_time_raw); let last_heartbeat_raw = time_gen.generate(d)?; diff --git a/config/src/display.rs b/config/src/display.rs index 4842ff7ed..09731c563 100644 --- a/config/src/display.rs +++ b/config/src/display.rs @@ -333,7 +333,7 @@ impl Display for GwConfigMeta { let error = self .error .as_ref() - .map_or("none".to_string(), |e| e.to_string()); + .map_or("none".to_string(), std::string::ToString::to_string); let is_rollback = if self.is_rollback { "(rollback)" } else { "" }; diff --git a/config/src/external/gwgroup.rs b/config/src/external/gwgroup.rs index 377657024..67da84393 100644 --- a/config/src/external/gwgroup.rs +++ b/config/src/external/gwgroup.rs @@ -332,7 +332,7 @@ mod test { fn test_bgp_community_setup() { let comtable = sample_community_table(); let mut gwtable = build_sample_gw_groups(); - gwtable.iter_mut().for_each(|group| group.sort_members()); + gwtable.iter_mut().for_each(GwGroup::sort_members); println!("{gwtable}"); println!("{comtable}"); diff --git a/config/src/external/overlay/vpcpeering.rs b/config/src/external/overlay/vpcpeering.rs index 1d7b7d8e7..45eda90b6 100644 --- a/config/src/external/overlay/vpcpeering.rs +++ b/config/src/external/overlay/vpcpeering.rs @@ -249,9 +249,15 @@ impl VpcExpose { // only V4 atm vec![Prefix::root_v4()] } else if let Some(nat) = self.nat.as_ref() { - nat.as_range.iter().map(|p| p.prefix()).collect::>() + nat.as_range + .iter() + .map(PrefixWithOptionalPorts::prefix) + .collect::>() } else { - self.ips.iter().map(|p| p.prefix()).collect::>() + self.ips + .iter() + .map(PrefixWithOptionalPorts::prefix) + .collect::>() } } @@ -442,7 +448,7 @@ impl VpcExpose { fn prefixes_size(prefixes: &PrefixPortsSet) -> PrefixWithPortsSize { prefixes .iter() - .map(|p| p.size()) + .map(PrefixWithOptionalPorts::size) .sum::() } let zero_size = ppsize_zero(); @@ -528,7 +534,7 @@ impl VpcManifest { } #[must_use] pub fn has_host_prefixes(&self) -> bool { - self.exposes.iter().any(|expose| expose.has_host_prefixes()) + self.exposes.iter().any(VpcExpose::has_host_prefixes) } fn validate_expose_collisions(&self) -> ConfigResult { // Check that prefixes in each expose don't overlap with prefixes in other exposes diff --git a/config/src/external/underlay/mod.rs b/config/src/external/underlay/mod.rs index d47954d25..5573550d8 100644 --- a/config/src/external/underlay/mod.rs +++ b/config/src/external/underlay/mod.rs @@ -79,7 +79,7 @@ impl Underlay { self.vrf .interfaces .values() - .try_for_each(|iface| iface.validate())?; + .try_for_each(InterfaceConfig::validate)?; // set vtep information if a vtep interface has been specified in the config self.vtep = self.get_vtep_info()?; diff --git a/config/src/internal/device/tracecfg.rs b/config/src/internal/device/tracecfg.rs index 20851dd3a..c0efc3014 100644 --- a/config/src/internal/device/tracecfg.rs +++ b/config/src/internal/device/tracecfg.rs @@ -37,7 +37,7 @@ impl TracingConfig { } pub fn validate(&self) -> ConfigResult { debug!("Validating tracing configuration.."); - let tags: Vec<&str> = self.tags.keys().map(|k| k.as_str()).collect(); + let tags: Vec<&str> = self.tags.keys().map(String::as_str).collect(); Ok(get_trace_ctl().check_tags(&tags)?) } } diff --git a/config/src/lib.rs b/config/src/lib.rs index 0cd826887..4675d74ea 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -15,7 +15,6 @@ clippy::expect_used, clippy::panic )] -#![allow(clippy::redundant_closure_for_method_calls)] #![allow(clippy::doc_markdown)] #![allow(clippy::missing_errors_doc)] #![allow(clippy::struct_excessive_bools)] From 830ac616ad5cb9b8ffe4295b2072d9f12f40ef08 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 23 Mar 2026 13:12:24 -0600 Subject: [PATCH 2/4] docs(config): deny clippy::doc_markdown Remove `#![allow(clippy::doc_markdown)]` and add backticks around type names in doc comments throughout the config crate. Co-authored-by: Claude Opus 4.6 Signed-off-by: Daniel Noland --- config/src/converters/k8s/status/bgp.rs | 2 +- config/src/external/overlay/validation_tests.rs | 2 +- config/src/external/overlay/vpcpeering.rs | 2 +- config/src/lib.rs | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/config/src/converters/k8s/status/bgp.rs b/config/src/converters/k8s/status/bgp.rs index 979ada8c9..e718badea 100644 --- a/config/src/converters/k8s/status/bgp.rs +++ b/config/src/converters/k8s/status/bgp.rs @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Open Network Fabric Authors -//! Converters for internal BGP status -> K8s GatewayAgentStatusStateBgp CRD. +//! Converters for internal BGP status -> K8s `GatewayAgentStatusStateBgp` CRD. use std::collections::BTreeMap; diff --git a/config/src/external/overlay/validation_tests.rs b/config/src/external/overlay/validation_tests.rs index 9bb8b6c7b..75b2ecf59 100644 --- a/config/src/external/overlay/validation_tests.rs +++ b/config/src/external/overlay/validation_tests.rs @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Open Network Fabric Authors -//! Validation tests for VpcExpose / VpcPeering / Overlay +//! Validation tests for `VpcExpose` / `VpcPeering` / Overlay //! //! These tests cover the expected semantics and restrictions for Expose objects in VPC peerings. //! diff --git a/config/src/external/overlay/vpcpeering.rs b/config/src/external/overlay/vpcpeering.rs index 45eda90b6..414a54f57 100644 --- a/config/src/external/overlay/vpcpeering.rs +++ b/config/src/external/overlay/vpcpeering.rs @@ -701,7 +701,7 @@ impl VpcPeering { } } - /// Create a VpcPeering mapped to a group called "default". + /// Create a `VpcPeering` mapped to a group called "default". /// This should only be used for tests #[must_use] pub fn with_default_group(name: &str, left: VpcManifest, right: VpcManifest) -> Self { diff --git a/config/src/lib.rs b/config/src/lib.rs index 4675d74ea..ef3297114 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -15,7 +15,6 @@ clippy::expect_used, clippy::panic )] -#![allow(clippy::doc_markdown)] #![allow(clippy::missing_errors_doc)] #![allow(clippy::struct_excessive_bools)] From a8c2457ee4b20b826b9b948ec3b2ca5715afcc87 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 23 Mar 2026 13:13:58 -0600 Subject: [PATCH 3/4] docs(config): deny clippy::missing_errors_doc Remove `#![allow(clippy::missing_errors_doc)]` and add errors doc sections to all public functions returning Result throughout the config crate. Co-authored-by: Claude Opus 4.6 Signed-off-by: Daniel Noland --- config/src/external/communities.rs | 4 ++ config/src/external/gwgroup.rs | 11 ++++ config/src/external/mod.rs | 5 ++ config/src/external/overlay/mod.rs | 8 +++ config/src/external/overlay/vpcpeering.rs | 67 ++++++++++++++------- config/src/external/underlay/mod.rs | 5 ++ config/src/gwconfig.rs | 6 +- config/src/internal/device/mod.rs | 5 ++ config/src/internal/device/tracecfg.rs | 5 ++ config/src/internal/interfaces/interface.rs | 5 ++ config/src/internal/mod.rs | 5 ++ config/src/internal/routing/prefixlist.rs | 10 +++ config/src/internal/routing/routemap.rs | 5 ++ config/src/internal/routing/vrf.rs | 4 ++ config/src/lib.rs | 1 - 15 files changed, 121 insertions(+), 25 deletions(-) diff --git a/config/src/external/communities.rs b/config/src/external/communities.rs index 0f2ebbecf..139983723 100644 --- a/config/src/external/communities.rs +++ b/config/src/external/communities.rs @@ -16,6 +16,10 @@ impl PriorityCommunityTable { Self::default() } /// Insert a community + /// + /// # Errors + /// + /// Returns [`ConfigError::DuplicateCommunity`] if the community already exists in the table. pub fn insert(&mut self, order: usize, community: &str) -> Result<(), ConfigError> { if self.0.iter().any(|(_, comm)| comm == community) { return Err(ConfigError::DuplicateCommunity(community.to_string())); diff --git a/config/src/external/gwgroup.rs b/config/src/external/gwgroup.rs index 67da84393..c7b7e2735 100644 --- a/config/src/external/gwgroup.rs +++ b/config/src/external/gwgroup.rs @@ -77,6 +77,12 @@ impl GwGroup { //N.B. we reverse the operands since want the most preferred first self.members.sort_by(|m1, m2| m2.cmp(m1)); } + /// Add a member to the gateway group. + /// + /// # Errors + /// + /// Returns [`ConfigError::DuplicateMember`] if a member with the same name already exists. + /// Returns [`ConfigError::DuplicateMemberAddress`] if a member with the same IP address already exists. pub fn add_member(&mut self, member: GwGroupMember) -> Result<(), ConfigError> { if self.get_member_by_name(&member.name).is_some() { return Err(ConfigError::DuplicateMember(member.name.clone())); @@ -126,6 +132,11 @@ impl GwGroupTable { pub fn new() -> Self { Self::default() } + /// Add a gateway group to the table. + /// + /// # Errors + /// + /// Returns [`ConfigError::DuplicateGroup`] if a group with the same name already exists. pub fn add_group(&mut self, group: GwGroup) -> Result<(), ConfigError> { if self.0.contains_key(group.name()) { return Err(ConfigError::DuplicateGroup(group.name().to_owned())); diff --git a/config/src/external/mod.rs b/config/src/external/mod.rs index e8c2ecc3e..d8be5c668 100644 --- a/config/src/external/mod.rs +++ b/config/src/external/mod.rs @@ -93,6 +93,11 @@ impl ExternalConfig { } Ok(()) } + /// Validate the external configuration. + /// + /// # Errors + /// + /// Returns a [`ConfigError`] if validation fails. pub fn validate(&mut self) -> ConfigResult { self.device.validate()?; self.underlay.validate()?; diff --git a/config/src/external/overlay/mod.rs b/config/src/external/overlay/mod.rs index 525c78283..01fe756fe 100644 --- a/config/src/external/overlay/mod.rs +++ b/config/src/external/overlay/mod.rs @@ -39,6 +39,10 @@ impl Overlay { } /// Validate all peerings, checking if the VPCs they refer to exist in vpc table + /// + /// # Errors + /// + /// Returns an error if a peering references a VPC that does not exist in the VPC table. pub fn validate_peerings(&self) -> ConfigResult { debug!("Validating VPC peerings..."); for peering in self.peering_table.values() { @@ -60,6 +64,10 @@ impl Overlay { } /// Top most validation function for `Overlay` configuration + /// + /// # Errors + /// + /// Returns an error if the overlay configuration is invalid. pub fn validate(&mut self) -> ConfigResult { debug!("Validating overlay configuration..."); diff --git a/config/src/external/overlay/vpcpeering.rs b/config/src/external/overlay/vpcpeering.rs index 414a54f57..d54a7e375 100644 --- a/config/src/external/overlay/vpcpeering.rs +++ b/config/src/external/overlay/vpcpeering.rs @@ -83,11 +83,11 @@ pub struct VpcExpose { pub nat: Option, } impl VpcExpose { - // Make the [`VpcExpose`] use stateless NAT. - // - // # Errors - // - // Returns an error if the [`VpcExpose`] already has a different NAT mode. + /// Make the [`VpcExpose`] use stateless NAT. + /// + /// # Errors + /// + /// Returns an error if the [`VpcExpose`] already has a different NAT mode. pub fn make_stateless_nat(mut self) -> Result { match self.nat.as_mut() { Some(nat) if nat.is_stateless() => Ok(self), @@ -103,12 +103,12 @@ impl VpcExpose { } } - // Make the [`VpcExpose`] use stateful NAT, with the given idle timeout, if provided. - // If the [`VpcExpose`] is already in stateful mode, the idle timeout is overwritten. - // - // # Errors - // - // Returns an error if the [`VpcExpose`] already has a different NAT mode. + /// Make the [`VpcExpose`] use stateful NAT, with the given idle timeout, if provided. + /// If the [`VpcExpose`] is already in stateful mode, the idle timeout is overwritten. + /// + /// # Errors + /// + /// Returns an error if the [`VpcExpose`] already has a different NAT mode. pub fn make_stateful_nat( mut self, idle_timeout: Option, @@ -132,15 +132,15 @@ impl VpcExpose { } } - // Make the [`VpcExpose`] use port forwarding, with the given idle timeout, if provided, and the - // given L4 protocol, if provided. - // - // If the [`VpcExpose`] is already in port forwarding mode, the idle timeout and L4 protocol are - // overwritten. - // - // # Errors - // - // Returns an error if the [`VpcExpose`] already has a different NAT mode. + /// Make the [`VpcExpose`] use port forwarding, with the given idle timeout, if provided, and the + /// given L4 protocol, if provided. + /// + /// If the [`VpcExpose`] is already in port forwarding mode, the idle timeout and L4 protocol are + /// overwritten. + /// + /// # Errors + /// + /// Returns an error if the [`VpcExpose`] already has a different NAT mode. pub fn make_port_forwarding( mut self, idle_timeout: Option, @@ -223,6 +223,11 @@ impl VpcExpose { self.nots.insert(prefix); self } + /// Add a prefix to the NAT `as` range. + /// + /// # Errors + /// + /// Returns an error if the expose has no NAT configuration. pub fn as_range(mut self, prefix: PrefixWithOptionalPorts) -> Result { let nat = self.nat.as_mut().ok_or(ConfigError::MissingParameter( "'as' block requires NAT configuration for the expose", @@ -230,6 +235,11 @@ impl VpcExpose { nat.as_range.insert(prefix); Ok(self) } + /// Add a prefix to the NAT `not as` exclusion set. + /// + /// # Errors + /// + /// Returns an error if the expose has no NAT configuration. pub fn not_as(mut self, prefix: PrefixWithOptionalPorts) -> Result { let nat = self.nat.as_mut().ok_or(ConfigError::MissingParameter( "'not' prefix for 'as' block requires NAT configuration for the expose", @@ -367,7 +377,11 @@ impl VpcExpose { Ok(()) } - /// Validate the [`VpcExpose`]: + /// Validate the [`VpcExpose`]. + /// + /// # Errors + /// + /// Returns an error if the expose configuration is invalid. #[allow(clippy::too_many_lines)] pub fn validate(&self) -> ConfigResult { // Check default exposes and prefixes @@ -608,6 +622,11 @@ impl VpcManifest { pub fn add_exposes(&mut self, exposes: impl IntoIterator) { self.exposes.extend(exposes); } + /// Validate the [`VpcManifest`]. + /// + /// # Errors + /// + /// Returns an error if the manifest configuration is invalid. pub fn validate(&self) -> ConfigResult { if self.name.is_empty() { return Err(ConfigError::MissingIdentifier("Manifest name")); @@ -750,7 +769,11 @@ impl VpcPeeringTable { self.0.is_empty() } - /// Add a [`VpcPeering`] to a [`VpcPeeringTable`] + /// Add a [`VpcPeering`] to a [`VpcPeeringTable`]. + /// + /// # Errors + /// + /// Returns an error if the peering name is missing or a duplicate peering exists. pub fn add(&mut self, peering: VpcPeering) -> ConfigResult { if peering.name.is_empty() { return Err(ConfigError::MissingIdentifier("Peering name")); diff --git a/config/src/external/underlay/mod.rs b/config/src/external/underlay/mod.rs index 5573550d8..3c6f61976 100644 --- a/config/src/external/underlay/mod.rs +++ b/config/src/external/underlay/mod.rs @@ -72,6 +72,11 @@ impl Underlay { } } + /// Validate the underlay configuration. + /// + /// # Errors + /// + /// Returns an error if any interface is invalid or VTEP configuration is wrong. pub fn validate(&mut self) -> ConfigResult { debug!("Validating underlay configuration..."); diff --git a/config/src/gwconfig.rs b/config/src/gwconfig.rs index f0ecf12d1..4b7190502 100644 --- a/config/src/gwconfig.rs +++ b/config/src/gwconfig.rs @@ -109,9 +109,11 @@ impl GwConfig { self.external.genid } - ////////////////////////////////////////////////////////////////// /// Validate a [`GwConfig`]. We only validate the external. - ////////////////////////////////////////////////////////////////// + /// + /// # Errors + /// + /// Returns a [`ConfigError`] if the external configuration fails validation. pub fn validate(&mut self) -> ConfigResult { debug!("Validating external config with genid {} ..", self.genid()); self.external.validate() diff --git a/config/src/internal/device/mod.rs b/config/src/internal/device/mod.rs index 92b7f6797..1f2c33d93 100644 --- a/config/src/internal/device/mod.rs +++ b/config/src/internal/device/mod.rs @@ -22,6 +22,11 @@ impl DeviceConfig { pub fn set_tracing(&mut self, tracing: TracingConfig) { self.tracing = Some(tracing); } + /// Validate the device configuration. + /// + /// # Errors + /// + /// Returns an error if the device configuration is invalid. pub fn validate(&self) -> ConfigResult { debug!("Validating device configuration.."); if let Some(tracing) = &self.tracing { diff --git a/config/src/internal/device/tracecfg.rs b/config/src/internal/device/tracecfg.rs index c0efc3014..60108e375 100644 --- a/config/src/internal/device/tracecfg.rs +++ b/config/src/internal/device/tracecfg.rs @@ -35,6 +35,11 @@ impl TracingConfig { pub fn add_tag(&mut self, tag: &str, level: LevelFilter) { let _ = self.tags.insert(tag.to_string(), level); } + /// Validate the tracing configuration. + /// + /// # Errors + /// + /// Returns an error if any configured trace tag is unknown. pub fn validate(&self) -> ConfigResult { debug!("Validating tracing configuration.."); let tags: Vec<&str> = self.tags.keys().map(String::as_str).collect(); diff --git a/config/src/internal/interfaces/interface.rs b/config/src/internal/interfaces/interface.rs index bca4a9968..2b2e2aa17 100644 --- a/config/src/internal/interfaces/interface.rs +++ b/config/src/internal/interfaces/interface.rs @@ -156,6 +156,11 @@ impl InterfaceConfig { matches!(self.iftype, InterfaceType::Vtep(_)) } + /// Validate the interface configuration. + /// + /// # Errors + /// + /// Returns an error if the interface name is empty. pub fn validate(&self) -> ConfigResult { // name is mandatory if self.name.is_empty() { diff --git a/config/src/internal/mod.rs b/config/src/internal/mod.rs index c16a4035a..f1670c846 100644 --- a/config/src/internal/mod.rs +++ b/config/src/internal/mod.rs @@ -68,6 +68,11 @@ impl InternalConfig { pub fn get_vtep(&self) -> &Option { &self.vtep } + /// Add a VRF configuration to the internal config. + /// + /// # Errors + /// + /// Returns an error if the VRF has duplicate fields (name, table ID, or VNI). pub fn add_vrf_config(&mut self, vrf_cfg: VrfConfig) -> ConfigResult { self.vrfs.add_vrf_config(vrf_cfg) } diff --git a/config/src/internal/routing/prefixlist.rs b/config/src/internal/routing/prefixlist.rs index 088e854dd..b2eddaae2 100644 --- a/config/src/internal/routing/prefixlist.rs +++ b/config/src/internal/routing/prefixlist.rs @@ -66,6 +66,11 @@ impl PrefixList { entries: BTreeMap::new(), } } + /// Add an entry to the prefix list. + /// + /// # Errors + /// + /// Returns an error if the entry has an incompatible IP version or the sequence number is a duplicate. pub fn add_entry(&mut self, seq: Option, mut entry: PrefixListEntry) -> ConfigResult { if !entry.is_version_compatible(self.ipver) { let msg = format!( @@ -94,6 +99,11 @@ impl PrefixList { self.entries.insert(seq, entry); Ok(()) } + /// Add multiple entries to the prefix list. + /// + /// # Errors + /// + /// Returns an error if any entry has an incompatible IP version or a duplicate sequence number. pub fn add_entries( &mut self, entries: impl IntoIterator, diff --git a/config/src/internal/routing/routemap.rs b/config/src/internal/routing/routemap.rs index b55a3b107..439c509f1 100644 --- a/config/src/internal/routing/routemap.rs +++ b/config/src/internal/routing/routemap.rs @@ -101,6 +101,11 @@ impl RouteMap { entries: BTreeMap::new(), } } + /// Add an entry to the route map. + /// + /// # Errors + /// + /// Returns an error if the sequence number is a duplicate. pub fn add_entry(&mut self, seq: Option, entry: RouteMapEntry) -> ConfigResult { let seq = if let Some(n) = seq { n diff --git a/config/src/internal/routing/vrf.rs b/config/src/internal/routing/vrf.rs index dd884fe53..86601af50 100644 --- a/config/src/internal/routing/vrf.rs +++ b/config/src/internal/routing/vrf.rs @@ -137,6 +137,10 @@ impl VrfConfigTable { ////////////////////////////////////////////////////////// /// Store a `VrfConfig` object in this `VrfConfigTable` + /// + /// # Errors + /// + /// Returns an error if the VRF has duplicate fields (name, table ID, or VNI). ////////////////////////////////////////////////////////// pub fn add_vrf_config(&mut self, vrf_cfg: VrfConfig) -> ConfigResult { let name = vrf_cfg.name.clone(); diff --git a/config/src/lib.rs b/config/src/lib.rs index ef3297114..cdc3ab76b 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -15,7 +15,6 @@ clippy::expect_used, clippy::panic )] -#![allow(clippy::missing_errors_doc)] #![allow(clippy::struct_excessive_bools)] pub mod converters; From bda638a1c92afafd3d3f1b8fedf03b29a7074290 Mon Sep 17 00:00:00 2001 From: Daniel Noland Date: Mon, 23 Mar 2026 13:14:56 -0600 Subject: [PATCH 4/4] chore(config): deny clippy::struct_excessive_bools Remove `#![allow(clippy::struct_excessive_bools)]` and add per-struct `#[allow(clippy::struct_excessive_bools)]` annotations on BGP and BMP config structs where booleans directly model protocol flags. The lint removal was actually perfectly fine, but should be done on a per struct level rather than package wide. Co-authored-by: Claude Opus 4.6 Signed-off-by: Daniel Noland --- config/src/internal/routing/bgp.rs | 5 +++++ config/src/internal/routing/bmp.rs | 1 + config/src/lib.rs | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config/src/internal/routing/bgp.rs b/config/src/internal/routing/bgp.rs index a27e6c5ed..f4c796d5a 100644 --- a/config/src/internal/routing/bgp.rs +++ b/config/src/internal/routing/bgp.rs @@ -51,6 +51,7 @@ pub struct AfIpv6Ucast { } #[derive(Clone, Debug, Default)] +#[allow(clippy::struct_excessive_bools)] pub struct AfL2vpnEvpn { pub adv_all_vni: bool, pub adv_default_gw: bool, @@ -64,6 +65,7 @@ pub struct AfL2vpnEvpn { } #[derive(Clone, Debug, Default)] +#[allow(clippy::struct_excessive_bools)] pub struct BgpNeighCapabilities { pub dynamic: bool, pub ext_nhop: bool, @@ -119,6 +121,7 @@ impl BgpNeighAF { #[derive(Clone, Debug, Default)] /// A BGP neighbor config +#[allow(clippy::struct_excessive_bools)] pub struct BgpNeighbor { pub ntype: BgpNeighType, pub remote_as: Option, @@ -159,6 +162,7 @@ pub struct BgpNeighbor { } #[derive(Clone, Debug, Default)] +#[allow(clippy::struct_excessive_bools)] pub struct BgpDefaultsAF { flow_spec: bool, labeled_unicast: bool, @@ -178,6 +182,7 @@ pub struct BgpDefaults { #[derive(Clone, Debug)] /// BGP global configuration options +#[allow(clippy::struct_excessive_bools)] pub struct BgpOptions { pub network_import_check: bool, pub ebgp_requires_policy: bool, diff --git a/config/src/internal/routing/bmp.rs b/config/src/internal/routing/bmp.rs index 126f3249d..5b297ef10 100644 --- a/config/src/internal/routing/bmp.rs +++ b/config/src/internal/routing/bmp.rs @@ -26,6 +26,7 @@ pub enum BmpSource { } #[derive(Clone, Debug)] +#[allow(clippy::struct_excessive_bools)] pub struct BmpOptions { /// Name for `bmp targets ` pub target_name: String, diff --git a/config/src/lib.rs b/config/src/lib.rs index cdc3ab76b..57115bd98 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -15,7 +15,6 @@ clippy::expect_used, clippy::panic )] -#![allow(clippy::struct_excessive_bools)] pub mod converters; pub mod display;