Skip to content

Commit bc99208

Browse files
committed
chore: fix lint
1 parent 6a3f53d commit bc99208

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/deployment.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,11 @@ pub fn generate_tunnel_args(svc: &Service) -> Result<Vec<String>, ReconcileError
113113
// .flatten()
114114
// .unwrap_or_else(|| "R".to_string());
115115

116-
let proxy_protocol = svc
117-
.metadata
118-
.annotations
119-
.as_ref()
120-
.map_or(false, |annotations| {
121-
annotations.get(EXIT_NODE_PROXY_PROTOCOL_LABEL) == Some(&"true".to_string())
122-
});
123-
116+
let proxy_protocol = svc.metadata.annotations.as_ref().and_then(|annotations| {
117+
annotations
118+
.get(EXIT_NODE_PROXY_PROTOCOL_LABEL)
119+
.map(String::as_ref)
120+
}) == Some("true");
124121
let target_ip = if proxy_protocol { "RP" } else { "R" };
125122

126123
// We can unwrap safely since Service is guaranteed to have a spec

0 commit comments

Comments
 (0)