Skip to content

Commit 2d2bc4f

Browse files
Aaalibaba42bwoebi
andauthored
chore: clippy (#1889)
# What does this PR do? A brief description of the change being made with this pull request. # Motivation What inspired you to submit this pull request? # Additional Notes Anything else we should know when reviewing? # How to test the change? Describe here in detail how the change can be validated. Co-authored-by: bob.weinand <bob.weinand@datadoghq.com>
1 parent 686314b commit 2d2bc4f

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

libdd-common-ffi/src/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ mod tests {
181181
let vec = vec![0, 2, 4, 6];
182182
let ffi_vec: Vec<u8> = Vec::from(vec.clone());
183183

184-
for (a, b) in vec.iter().zip(ffi_vec.into_iter()) {
184+
for (a, b) in vec.iter().zip(&ffi_vec) {
185185
assert_eq!(a, b)
186186
}
187187
}

libdd-trace-obfuscation/src/ip_address.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,8 @@ fn parse_ip(s: &str) -> Option<(&str, &str)> {
104104
match ch {
105105
'0'..='9' => continue,
106106
'.' | '-' | '_' => return parse_ip_v4(s, ch),
107-
':' | 'A'..='F' | 'a'..='f' => {
108-
if s.parse::<Ipv6Addr>().is_ok() {
109-
return Some((s, ""));
110-
} else {
111-
return None;
112-
}
107+
':' | 'A'..='F' | 'a'..='f' if s.parse::<Ipv6Addr>().is_ok() => {
108+
return Some((s, ""));
113109
}
114110
'[' => {
115111
// Parse IPv6 in [host]:port format

0 commit comments

Comments
 (0)