Skip to content

Commit 3157fdd

Browse files
authored
bug: Use new state if error in record_reliability (#1018)
This includes some fix-ups for rust 1.89.0 Closes: PUSH-567
1 parent f640074 commit 3157fdd

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

autopush-common/src/db/routing.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Rust 1.89.0 flags `StorageType` as unused even with `bigtable` set as a default feature.
2+
#[allow(dead_code)]
13
#[derive(Clone, Eq, PartialEq, Debug)]
24
pub(crate) enum StorageType {
35
BigTable,

autopush-common/src/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub trait StatsdClientExt {
1616
fn incr_raw(&self, metric: &str) -> MetricResult<Counter>;
1717

1818
/// Start a counter with tags using a MetricName enum
19-
fn incr_with_tags(&self, metric: MetricName) -> MetricBuilder<Counter>;
19+
fn incr_with_tags(&self, metric: MetricName) -> MetricBuilder<'_, '_, Counter>;
2020
}
2121

2222
impl StatsdClientExt for StatsdClient {
@@ -29,7 +29,7 @@ impl StatsdClientExt for StatsdClient {
2929
self.count(metric, 1)
3030
}
3131

32-
fn incr_with_tags(&self, metric: MetricName) -> MetricBuilder<Counter> {
32+
fn incr_with_tags(&self, metric: MetricName) -> MetricBuilder<'_, '_, Counter> {
3333
let metric_tag: &'static str = metric.into();
3434
self.count_with_tags(metric_tag, 1)
3535
}

autopush-common/src/notification.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl Notification {
9494
.inspect_err(|e| {
9595
warn!("🔍⚠️ Unable to record reliability state log: {:?}", e);
9696
})
97-
.unwrap_or_default();
97+
.unwrap_or(Some(state));
9898
}
9999

100100
#[cfg(feature = "reliable_report")]

0 commit comments

Comments
 (0)