Skip to content

Commit 5a89924

Browse files
committed
cargo fmt
Signed-off-by: Jesse Szwedko <[email protected]>
1 parent 8c383de commit 5a89924

File tree

10 files changed

+74
-38
lines changed

10 files changed

+74
-38
lines changed

lib/prometheus-parser/src/lib.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ mod test {
319319
assert!(matches!(
320320
error,
321321
ParserError::WithLine {
322-
kind: ErrorKind::ExpectedChar { expected: ',', .. }, ..
322+
kind: ErrorKind::ExpectedChar { expected: ',', .. },
323+
..
323324
}
324325
));
325326

@@ -329,7 +330,8 @@ mod test {
329330
assert!(matches!(
330331
error,
331332
ParserError::WithLine {
332-
kind: ErrorKind::InvalidMetricKind { .. }, ..
333+
kind: ErrorKind::InvalidMetricKind { .. },
334+
..
333335
}
334336
));
335337

@@ -339,7 +341,8 @@ mod test {
339341
assert!(matches!(
340342
error,
341343
ParserError::WithLine {
342-
kind: ErrorKind::ExpectedSpace { .. }, ..
344+
kind: ErrorKind::ExpectedSpace { .. },
345+
..
343346
}
344347
));
345348

@@ -349,7 +352,8 @@ mod test {
349352
assert!(matches!(
350353
error,
351354
ParserError::WithLine {
352-
kind: ErrorKind::ExpectedChar { expected: '"', .. }, ..
355+
kind: ErrorKind::ExpectedChar { expected: '"', .. },
356+
..
353357
}
354358
));
355359

@@ -359,7 +363,8 @@ mod test {
359363
assert!(matches!(
360364
error,
361365
ParserError::WithLine {
362-
kind: ErrorKind::ExpectedChar { expected: '"', .. }, ..
366+
kind: ErrorKind::ExpectedChar { expected: '"', .. },
367+
..
363368
}
364369
));
365370

@@ -369,7 +374,8 @@ mod test {
369374
assert!(matches!(
370375
error,
371376
ParserError::WithLine {
372-
kind: ErrorKind::ParseFloatError { .. }, ..
377+
kind: ErrorKind::ParseFloatError { .. },
378+
..
373379
}
374380
));
375381
}

lib/prometheus-parser/src/line.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,10 +611,7 @@ mod test {
611611
let input = wrap(r#"{ a="b" ,, c="d" }"#);
612612
let error = Metric::parse_labels(&input).unwrap_err().into();
613613
println!("{}", error);
614-
assert!(matches!(
615-
error,
616-
ErrorKind::ParseNameError { .. }
617-
));
614+
assert!(matches!(error, ErrorKind::ParseNameError { .. }));
618615
}
619616

620617
#[test]

lib/remap-functions/src/to_int.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ impl Function for ToInt {
1212
fn parameters(&self) -> &'static [Parameter] {
1313
&[Parameter {
1414
keyword: "value",
15-
accepts: |v| matches!(v, Value::Integer(_) | Value::Float(_) | Value::Bytes(_) | Value::Boolean(_) | Value::Timestamp(_) | Value::Null),
15+
accepts: |v| {
16+
matches!(
17+
v,
18+
Value::Integer(_)
19+
| Value::Float(_)
20+
| Value::Bytes(_)
21+
| Value::Boolean(_)
22+
| Value::Timestamp(_)
23+
| Value::Null
24+
)
25+
},
1626
required: true,
1727
}]
1828
}

lib/remap-functions/src/to_timestamp.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ impl Function for ToTimestamp {
1616
accepts: |v| {
1717
matches!(
1818
v,
19-
Value::Integer(_) |
20-
Value::Float(_) |
21-
Value::Bytes(_) |
22-
Value::Timestamp(_)
19+
Value::Integer(_) | Value::Float(_) | Value::Bytes(_) | Value::Timestamp(_)
2320
)
2421
},
2522
required: true,

src/kubernetes/stream.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ mod tests {
121121

122122
{
123123
let err = out_stream.next().await.unwrap().unwrap_err();
124-
assert!(matches!(err, Error::Reading { source: hyper::Error { .. } }));
124+
assert!(matches!(
125+
err,
126+
Error::Reading {
127+
source: hyper::Error { .. }
128+
}
129+
));
125130
}
126131

127132
assert!(out_stream.next().await.is_none());
@@ -139,7 +144,12 @@ mod tests {
139144

140145
{
141146
let err = out_stream.next().await.unwrap().unwrap_err();
142-
assert!(matches!(err, Error::Parsing { source: response::Error::Json(_) }));
147+
assert!(matches!(
148+
err,
149+
Error::Parsing {
150+
source: response::Error::Json(_)
151+
}
152+
));
143153
}
144154

145155
assert!(out_stream.next().await.is_none());

src/rusoto/auth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ mod tests {
101101
)
102102
.unwrap();
103103

104-
assert!(matches!(config.auth, AWSAuthentication::Role{..}));
104+
assert!(matches!(config.auth, AWSAuthentication::Role { .. }));
105105
}
106106

107107
#[test]
@@ -130,6 +130,6 @@ mod tests {
130130
)
131131
.unwrap();
132132

133-
assert!(matches!(config.auth, AWSAuthentication::Static{..}));
133+
assert!(matches!(config.auth, AWSAuthentication::Static { .. }));
134134
}
135135
}

src/sinks/aws_s3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ mod integration_tests {
701701
assert_downcast_matches!(
702702
config.healthcheck(client).await.unwrap_err(),
703703
HealthcheckError,
704-
HealthcheckError::UnknownBucket{ .. }
704+
HealthcheckError::UnknownBucket { .. }
705705
);
706706
}
707707

src/sinks/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ mod tests {
376376
assert_downcast_matches!(
377377
super::validate_headers(&config.request.headers, &None).unwrap_err(),
378378
BuildError,
379-
BuildError::InvalidHeaderName{..}
379+
BuildError::InvalidHeaderName { .. }
380380
);
381381
}
382382

src/sinks/util/adaptive_concurrency/tests.rs

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -406,24 +406,40 @@ async fn run_test(params: TestParams) -> TestResults {
406406
.map(|event| (event.name().to_string(), event))
407407
.collect::<HashMap<_, _>>();
408408
// Ensure basic statistics are captured, don't actually examine them
409-
assert!(
410-
matches!(metrics.get("adaptive_concurrency_observed_rtt").unwrap().data.value,
411-
MetricValue::Distribution { .. })
412-
);
413-
assert!(
414-
matches!(metrics.get("adaptive_concurrency_averaged_rtt").unwrap().data.value,
415-
MetricValue::Distribution { .. })
416-
);
409+
assert!(matches!(
410+
metrics
411+
.get("adaptive_concurrency_observed_rtt")
412+
.unwrap()
413+
.data
414+
.value,
415+
MetricValue::Distribution { .. }
416+
));
417+
assert!(matches!(
418+
metrics
419+
.get("adaptive_concurrency_averaged_rtt")
420+
.unwrap()
421+
.data
422+
.value,
423+
MetricValue::Distribution { .. }
424+
));
417425
if params.concurrency == Concurrency::Adaptive {
418-
assert!(
419-
matches!(metrics.get("adaptive_concurrency_limit").unwrap().data.value,
420-
MetricValue::Distribution { .. })
421-
);
426+
assert!(matches!(
427+
metrics
428+
.get("adaptive_concurrency_limit")
429+
.unwrap()
430+
.data
431+
.value,
432+
MetricValue::Distribution { .. }
433+
));
422434
}
423-
assert!(
424-
matches!(metrics.get("adaptive_concurrency_in_flight").unwrap().data.value,
425-
MetricValue::Distribution { .. })
426-
);
435+
assert!(matches!(
436+
metrics
437+
.get("adaptive_concurrency_in_flight")
438+
.unwrap()
439+
.data
440+
.value,
441+
MetricValue::Distribution { .. }
442+
));
427443

428444
TestResults { stats, cstats }
429445
}

src/sources/prometheus/scrape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ mod integration_tests {
435435
// Sample some well-known metrics
436436
let build = find_metric("prometheus_build_info");
437437
assert!(matches!(build.data.kind, MetricKind::Absolute));
438-
assert!(matches!(build.data.value, MetricValue::Gauge { ..}));
438+
assert!(matches!(build.data.value, MetricValue::Gauge { .. }));
439439
assert!(build.tags().unwrap().contains_key("branch"));
440440
assert!(build.tags().unwrap().contains_key("version"));
441441

0 commit comments

Comments
 (0)