Skip to content

Commit 4d2963e

Browse files
committed
rustfmt
1 parent e00483a commit 4d2963e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/middleware.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,17 @@ fn blocked_traffic() -> Vec<(String, Vec<String>)> {
112112
}
113113

114114
fn parse_traffic_patterns(patterns: &str) -> impl Iterator<Item = (&str, &str)> {
115-
patterns.split_terminator(',')
116-
.map(|pattern| {
117-
if let Some(idx) = pattern.find('=') {
118-
(&pattern[..idx], &pattern[(idx + 1)..])
119-
} else {
120-
panic!("BLOCKED_TRAFFIC must be in the form HEADER=VALUE_ENV_VAR, \
121-
got invalid pattern {}", pattern)
122-
}
123-
})
115+
patterns.split_terminator(',').map(|pattern| {
116+
if let Some(idx) = pattern.find('=') {
117+
(&pattern[..idx], &pattern[(idx + 1)..])
118+
} else {
119+
panic!(
120+
"BLOCKED_TRAFFIC must be in the form HEADER=VALUE_ENV_VAR, \
121+
got invalid pattern {}",
122+
pattern
123+
)
124+
}
125+
})
124126
}
125127

126128
#[test]

src/middleware/block_traffic.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ pub struct BlockTraffic {
1616

1717
impl BlockTraffic {
1818
pub fn new(header_name: String, blocked_values: Vec<String>) -> Self {
19-
Self { header_name, blocked_values, handler: None }
19+
Self {
20+
header_name,
21+
blocked_values,
22+
handler: None,
23+
}
2024
}
2125
}
2226

0 commit comments

Comments
 (0)