Skip to content

Commit b97f09c

Browse files
committed
add an exception for lint false positive mutable_key_type
Signed-off-by: Rajat Jindal <[email protected]>
1 parent ed1077f commit b97f09c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

crates/trigger/src/runtime_config.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ impl RuntimeConfig {
196196
for opts in &opt_layer.client_tls_opts {
197197
let parsed = parse_client_tls_opts(opts).context("parsing client tls options")?;
198198
for component_id in &opts.component_ids {
199+
#[allow(clippy::mutable_key_type)]
199200
let hostmap = parsed
200201
.hosts
201202
.clone()
@@ -636,6 +637,7 @@ ca_roots_file = "{}"
636637
.get(&"component-no1".to_string())
637638
.is_some());
638639

640+
#[allow(clippy::mutable_key_type)]
639641
let component_no1_client_tls_opts = client_tls_opts_ok
640642
.get(&"component-no1".to_string())
641643
.expect("get opts for component-no1");
@@ -653,6 +655,7 @@ ca_roots_file = "{}"
653655
.get(&"component-no2".to_string())
654656
.is_some());
655657

658+
#[allow(clippy::mutable_key_type)]
656659
let component_no2_client_tls_opts = client_tls_opts_ok
657660
.get(&"component-no2".to_string())
658661
.expect("get opts for component-no2");
@@ -712,6 +715,7 @@ ca_roots_file = "{}"
712715
.get(&"component-no1".to_string())
713716
.is_some());
714717

718+
#[allow(clippy::mutable_key_type)]
715719
let component_no1_client_tls_opts = client_tls_opts_ok
716720
.get(&"component-no1".to_string())
717721
.expect("get opts for component-no1");
@@ -789,9 +793,7 @@ fn parse_client_tls_opts(inp: &ClientTlsOpts) -> Result<ParsedClientTlsOpts, any
789793
// 2. custom_root_ca is not provided
790794
//
791795
// if custom_root_ca is provided, use_ca_webpki_roots defaults to false
792-
let ca_webpki_roots =
793-
inp.ca_webpki_roots
794-
.unwrap_or(if custom_root_ca_provided { false } else { true });
796+
let ca_webpki_roots = inp.ca_webpki_roots.unwrap_or(!custom_root_ca_provided);
795797

796798
let parsed_component_ids: Vec<String> = inp
797799
.component_ids

0 commit comments

Comments
 (0)