Upgrade to Rust v1.49.0

This commit is contained in:
Michael Vines
2021-01-23 11:55:15 -08:00
parent 7604edb16f
commit cbffab7850
36 changed files with 156 additions and 132 deletions

View File

@ -164,6 +164,7 @@ impl Counter {
}
}
pub fn init(&mut self) {
#![allow(deprecated)]
self.lograte
.compare_and_swap(0, Self::default_log_rate(), Ordering::Relaxed);
self.metricsrate
@ -188,6 +189,7 @@ impl Counter {
}
let lastlog = self.lastlog.load(Ordering::Relaxed);
#[allow(deprecated)]
let prev = self
.lastlog
.compare_and_swap(lastlog, counts, Ordering::Relaxed);

View File

@ -19,11 +19,11 @@ use std::{
type CounterMap = HashMap<(&'static str, u64), CounterPoint>;
impl Into<DataPoint> for CounterPoint {
fn into(self) -> DataPoint {
let mut point = DataPoint::new(self.name);
point.timestamp = self.timestamp;
point.add_field_i64("count", self.count);
impl From<CounterPoint> for DataPoint {
fn from(counter_point: CounterPoint) -> Self {
let mut point = Self::new(counter_point.name);
point.timestamp = counter_point.timestamp;
point.add_field_i64("count", counter_point.count);
point
}
}