Skip to content

Commit 0262f08

Browse files
authored
feat(profiling): ValueType::new is const and Hash (#1221)
1 parent 4e1d7bb commit 0262f08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

datadog-profiling/src/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ use datadog_profiling_protobuf::prost_impls;
55
use std::ops::{Add, Sub};
66
use std::time::{Duration, SystemTime, UNIX_EPOCH};
77

8-
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8+
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
99
pub struct ValueType<'a> {
1010
pub r#type: &'a str,
1111
pub unit: &'a str,
1212
}
1313

1414
impl<'a> ValueType<'a> {
1515
#[inline(always)]
16-
pub fn new(r#type: &'a str, unit: &'a str) -> Self {
16+
pub const fn new(r#type: &'a str, unit: &'a str) -> Self {
1717
Self { r#type, unit }
1818
}
1919
}

0 commit comments

Comments
 (0)