Skip to content

Commit f1914e8

Browse files
authored
fix clippy warnings (#600)
1 parent 2d99f82 commit f1914e8

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

metrics-exporter-dogstatsd/src/builder.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ mod tests {
435435
DogStatsDBuilder::default().with_aggregation_mode(AggregationMode::Aggressive);
436436
assert_eq!(builder.get_flush_interval(), DEFAULT_FLUSH_INTERVAL_AGGRESSIVE);
437437

438-
let custom_flush_interval = Duration::from_millis(123456789);
438+
let custom_flush_interval = Duration::from_millis(123_456_789);
439439
let builder = DogStatsDBuilder::default().with_flush_interval(custom_flush_interval);
440440
assert_eq!(builder.get_flush_interval(), custom_flush_interval);
441441
}
@@ -461,9 +461,7 @@ mod tests {
461461
assert_eq!(
462462
builder.unwrap_err(),
463463
BuildError::InvalidConfiguration {
464-
reason: format!(
465-
"maximum payload length (65528 bytes) exceeds UDP datagram maximum length (65527 bytes)"
466-
)
464+
reason: "maximum payload length (65528 bytes) exceeds UDP datagram maximum length (65527 bytes)".to_string()
467465
}
468466
);
469467
}
@@ -522,9 +520,7 @@ mod tests {
522520
assert_eq!(
523521
builder.unwrap_err(),
524522
BuildError::InvalidConfiguration {
525-
reason: format!(
526-
"maximum payload length (4294967296 bytes) exceeds theoretical upper bound (4294967295 bytes)"
527-
)
523+
reason: "maximum payload length (4294967296 bytes) exceeds theoretical upper bound (4294967295 bytes)".to_string()
528524
}
529525
);
530526
}

metrics-exporter-dogstatsd/src/writer.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ mod tests {
644644
(
645645
Key::from("test_counter"),
646646
666,
647-
Some(345678),
647+
Some(345_678),
648648
None,
649649
&[],
650650
"test_counter:666|c|T345678\n",
@@ -660,31 +660,31 @@ mod tests {
660660
(
661661
Key::from_parts("test_counter", &[("foo", "bar"), ("baz", "quux")]),
662662
777,
663-
Some(234567),
663+
Some(234_567),
664664
None,
665665
&[],
666666
"test_counter:777|c|#foo:bar,baz:quux|T234567\n",
667667
),
668668
(
669669
Key::from_parts("test_counter", &[("foo", "bar"), ("baz", "quux")]),
670670
777,
671-
Some(234567),
671+
Some(234_567),
672672
Some("server1"),
673673
&[],
674674
"server1.test_counter:777|c|#foo:bar,baz:quux|T234567\n",
675675
),
676676
(
677677
Key::from_parts("test_counter", &[("foo", "bar"), ("baz", "quux")]),
678678
777,
679-
Some(234567),
679+
Some(234_567),
680680
None,
681681
&[Label::new("gfoo", "bar"), Label::new("gbaz", "quux")][..],
682682
"test_counter:777|c|#foo:bar,baz:quux,gfoo:bar,gbaz:quux|T234567\n",
683683
),
684684
(
685685
Key::from_parts("test_counter", &[("foo", "bar"), ("baz", "quux")]),
686686
777,
687-
Some(234567),
687+
Some(234_567),
688688
Some("server1"),
689689
&[Label::new("gfoo", "bar"), Label::new("gbaz", "quux")][..],
690690
"server1.test_counter:777|c|#foo:bar,baz:quux,gfoo:bar,gbaz:quux|T234567\n",
@@ -709,7 +709,7 @@ mod tests {
709709
(
710710
Key::from("test_gauge"),
711711
1967.0,
712-
Some(345678),
712+
Some(345_678),
713713
None,
714714
&[],
715715
"test_gauge:1967.0|g|T345678\n",
@@ -725,31 +725,31 @@ mod tests {
725725
(
726726
Key::from_parts("test_gauge", &[("foo", "bar"), ("baz", "quux")]),
727727
3.13232,
728-
Some(234567),
728+
Some(234_567),
729729
None,
730730
&[],
731731
"test_gauge:3.13232|g|#foo:bar,baz:quux|T234567\n",
732732
),
733733
(
734734
Key::from_parts("test_gauge", &[("foo", "bar"), ("baz", "quux")]),
735735
3.13232,
736-
Some(234567),
736+
Some(234_567),
737737
Some("server1"),
738738
&[],
739739
"server1.test_gauge:3.13232|g|#foo:bar,baz:quux|T234567\n",
740740
),
741741
(
742742
Key::from_parts("test_gauge", &[("foo", "bar"), ("baz", "quux")]),
743743
3.13232,
744-
Some(234567),
744+
Some(234_567),
745745
None,
746746
&[Label::new("gfoo", "bar"), Label::new("gbaz", "quux")][..],
747747
"test_gauge:3.13232|g|#foo:bar,baz:quux,gfoo:bar,gbaz:quux|T234567\n",
748748
),
749749
(
750750
Key::from_parts("test_gauge", &[("foo", "bar"), ("baz", "quux")]),
751751
3.13232,
752-
Some(234567),
752+
Some(234_567),
753753
Some("server1"),
754754
&[Label::new("gfoo", "bar"), Label::new("gbaz", "quux")][..],
755755
"server1.test_gauge:3.13232|g|#foo:bar,baz:quux,gfoo:bar,gbaz:quux|T234567\n",

metrics-util/src/debugging.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ mod tests {
272272
),
273273
None,
274274
None,
275-
DebugValue::Gauge(OrderedFloat(456.0 as f64))
275+
DebugValue::Gauge(OrderedFloat(456.0))
276276
),
277277
(
278278
CompositeKey::new(
@@ -284,7 +284,7 @@ mod tests {
284284
),
285285
None,
286286
None,
287-
DebugValue::Gauge(OrderedFloat(654.0 as f64))
287+
DebugValue::Gauge(OrderedFloat(654.0))
288288
),
289289
(
290290
CompositeKey::new(

0 commit comments

Comments
 (0)