From 39a0474d6d70ac6c1bdb27d1d2a461cf6830540f Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Mon, 22 Sep 2025 11:36:23 +0200 Subject: [PATCH] Rust: Use an associated type for TestGetValue to make it clear it's an output parameter Generic parameters are an "input". A trait `TestGetValue` can be implemented for the same type multiple times with different concrete types `T`. That's never needed for `TestGetValue`, we only have a single type that should be returned from `test_get_value`. An associated parameter is the way to do that. --- CHANGELOG.md | 2 ++ glean-core/rlb/src/private/event.rs | 4 +++- glean-core/rlb/src/private/object.rs | 4 +++- glean-core/src/metrics/boolean.rs | 3 ++- glean-core/src/metrics/counter.rs | 4 +++- glean-core/src/metrics/custom_distribution.rs | 4 +++- glean-core/src/metrics/datetime.rs | 4 +++- glean-core/src/metrics/denominator.rs | 4 +++- glean-core/src/metrics/dual_labeled_counter.rs | 4 +++- glean-core/src/metrics/event.rs | 4 +++- glean-core/src/metrics/labeled.rs | 6 ++++-- glean-core/src/metrics/memory_distribution.rs | 4 +++- glean-core/src/metrics/mod.rs | 7 +++++-- glean-core/src/metrics/numerator.rs | 4 +++- glean-core/src/metrics/object.rs | 4 +++- glean-core/src/metrics/quantity.rs | 4 +++- glean-core/src/metrics/rate.rs | 4 +++- glean-core/src/metrics/string.rs | 4 +++- glean-core/src/metrics/string_list.rs | 4 +++- glean-core/src/metrics/text.rs | 4 +++- glean-core/src/metrics/timespan.rs | 3 ++- glean-core/src/metrics/timing_distribution.rs | 4 +++- glean-core/src/metrics/url.rs | 4 +++- glean-core/src/metrics/uuid.rs | 4 +++- glean-core/src/traits/boolean.rs | 2 +- glean-core/src/traits/counter.rs | 2 +- glean-core/src/traits/custom_distribution.rs | 2 +- glean-core/src/traits/datetime.rs | 2 +- glean-core/src/traits/dual_labeled_counter.rs | 2 +- glean-core/src/traits/event.rs | 2 +- glean-core/src/traits/memory_distribution.rs | 2 +- glean-core/src/traits/numerator.rs | 2 +- glean-core/src/traits/quantity.rs | 2 +- glean-core/src/traits/rate.rs | 2 +- glean-core/src/traits/string.rs | 2 +- glean-core/src/traits/string_list.rs | 2 +- glean-core/src/traits/text.rs | 2 +- glean-core/src/traits/timespan.rs | 2 +- glean-core/src/traits/timing_distribution.rs | 2 +- glean-core/src/traits/url.rs | 2 +- glean-core/src/traits/uuid.rs | 2 +- 41 files changed, 89 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98699511b6..383a74b24b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ [Full changelog](https://github.com/mozilla/glean/compare/v65.1.1...v65.2.0) +* Rust + * Rust: Use an associated type for `TestGetValue` ([#3259](https://github.com/mozilla/glean/pull/3259)) * Swift * Glean for iOS is now being built with Xcode 16.2 ([#3189](https://github.com/mozilla/glean/pull/3189)) * General diff --git a/glean-core/rlb/src/private/event.rs b/glean-core/rlb/src/private/event.rs index 9eab25194d..765305e91c 100644 --- a/glean-core/rlb/src/private/event.rs +++ b/glean-core/rlb/src/private/event.rs @@ -72,7 +72,9 @@ impl EventMetric { } #[inherent] -impl TestGetValue> for EventMetric { +impl TestGetValue for EventMetric { + type Output = Vec; + pub fn test_get_value(&self, ping_name: Option) -> Option> { self.inner.test_get_value(ping_name) } diff --git a/glean-core/rlb/src/private/object.rs b/glean-core/rlb/src/private/object.rs index 78b0e4d5d2..214e4175a8 100644 --- a/glean-core/rlb/src/private/object.rs +++ b/glean-core/rlb/src/private/object.rs @@ -39,7 +39,9 @@ impl<'a, K> MetricIdentifier<'a> for ObjectMetric { } } -impl TestGetValue for ObjectMetric { +impl TestGetValue for ObjectMetric { + type Output = JsonValue; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as JSON-encoded string. diff --git a/glean-core/src/metrics/boolean.rs b/glean-core/src/metrics/boolean.rs index 68b491ace7..3f63efbb91 100644 --- a/glean-core/src/metrics/boolean.rs +++ b/glean-core/src/metrics/boolean.rs @@ -120,7 +120,8 @@ impl BooleanMetric { } } -impl TestGetValue for BooleanMetric { +impl TestGetValue for BooleanMetric { + type Output = bool; /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as a boolean. diff --git a/glean-core/src/metrics/counter.rs b/glean-core/src/metrics/counter.rs index e992d27641..5087701a13 100644 --- a/glean-core/src/metrics/counter.rs +++ b/glean-core/src/metrics/counter.rs @@ -157,7 +157,9 @@ impl CounterMetric { } } -impl TestGetValue for CounterMetric { +impl TestGetValue for CounterMetric { + type Output = i32; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as an integer. diff --git a/glean-core/src/metrics/custom_distribution.rs b/glean-core/src/metrics/custom_distribution.rs index dcece3b071..193c143cee 100644 --- a/glean-core/src/metrics/custom_distribution.rs +++ b/glean-core/src/metrics/custom_distribution.rs @@ -303,7 +303,9 @@ impl CustomDistributionMetric { } } -impl TestGetValue for CustomDistributionMetric { +impl TestGetValue for CustomDistributionMetric { + type Output = DistributionData; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as an integer. diff --git a/glean-core/src/metrics/datetime.rs b/glean-core/src/metrics/datetime.rs index a75fe8409c..b6b39a4909 100644 --- a/glean-core/src/metrics/datetime.rs +++ b/glean-core/src/metrics/datetime.rs @@ -277,7 +277,9 @@ impl DatetimeMetric { } } -impl TestGetValue for DatetimeMetric { +impl TestGetValue for DatetimeMetric { + type Output = Datetime; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the stored datetime value. diff --git a/glean-core/src/metrics/denominator.rs b/glean-core/src/metrics/denominator.rs index b83f6b71c3..13094dcbe2 100644 --- a/glean-core/src/metrics/denominator.rs +++ b/glean-core/src/metrics/denominator.rs @@ -127,7 +127,9 @@ impl DenominatorMetric { } } -impl TestGetValue for DenominatorMetric { +impl TestGetValue for DenominatorMetric { + type Output = i32; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as an integer. diff --git a/glean-core/src/metrics/dual_labeled_counter.rs b/glean-core/src/metrics/dual_labeled_counter.rs index 6df0d67e65..bbb890b73d 100644 --- a/glean-core/src/metrics/dual_labeled_counter.rs +++ b/glean-core/src/metrics/dual_labeled_counter.rs @@ -231,7 +231,9 @@ impl DualLabeledCounterMetric { } } -impl TestGetValue>> for DualLabeledCounterMetric { +impl TestGetValue for DualLabeledCounterMetric { + type Output = HashMap>; + fn test_get_value( &self, ping_name: Option, diff --git a/glean-core/src/metrics/event.rs b/glean-core/src/metrics/event.rs index 0b4eea3aca..b788948f3e 100644 --- a/glean-core/src/metrics/event.rs +++ b/glean-core/src/metrics/event.rs @@ -212,7 +212,9 @@ impl EventMetric { } } -impl TestGetValue> for EventMetric { +impl TestGetValue for EventMetric { + type Output = Vec; + /// **Test-only API (exported for FFI purposes).** /// /// Get the vector of currently stored events for this event metric. diff --git a/glean-core/src/metrics/labeled.rs b/glean-core/src/metrics/labeled.rs index 117200e5d1..4642009c19 100644 --- a/glean-core/src/metrics/labeled.rs +++ b/glean-core/src/metrics/labeled.rs @@ -353,11 +353,13 @@ where } } -impl TestGetValue> for LabeledMetric +impl TestGetValue for LabeledMetric where - T: AllowLabeled + TestGetValue, + T: AllowLabeled + TestGetValue, S: Any, { + type Output = HashMap; + fn test_get_value(&self, ping_name: Option) -> Option> { let mut out = HashMap::new(); let map = self.label_map.lock().unwrap(); diff --git a/glean-core/src/metrics/memory_distribution.rs b/glean-core/src/metrics/memory_distribution.rs index a0186b5014..c27e6fefd9 100644 --- a/glean-core/src/metrics/memory_distribution.rs +++ b/glean-core/src/metrics/memory_distribution.rs @@ -324,7 +324,9 @@ impl MemoryDistributionMetric { } } -impl TestGetValue for MemoryDistributionMetric { +impl TestGetValue for MemoryDistributionMetric { + type Output = DistributionData; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value. diff --git a/glean-core/src/metrics/mod.rs b/glean-core/src/metrics/mod.rs index c76e82f522..a916d017d5 100644 --- a/glean-core/src/metrics/mod.rs +++ b/glean-core/src/metrics/mod.rs @@ -270,7 +270,10 @@ pub trait MetricIdentifier<'a> { } /// [`TestGetValue`] describes an interface for retrieving the value for a given metric -pub trait TestGetValue { +pub trait TestGetValue { + /// The output type of `test_get_value` + type Output; + /// **Test-only API (exported for FFI purposes).** /// /// Returns the currently stored value of the appropriate type for the given metric. @@ -285,7 +288,7 @@ pub trait TestGetValue { /// # Returns /// /// The stored value or `None` if nothing stored. - fn test_get_value(&self, ping_name: Option) -> Option; + fn test_get_value(&self, ping_name: Option) -> Option; } // Provide a blanket implementation for MetricIdentifier for all the types diff --git a/glean-core/src/metrics/numerator.rs b/glean-core/src/metrics/numerator.rs index d3c3e32842..c47fa4b2bf 100644 --- a/glean-core/src/metrics/numerator.rs +++ b/glean-core/src/metrics/numerator.rs @@ -76,7 +76,9 @@ impl NumeratorMetric { } } -impl TestGetValue for NumeratorMetric { +impl TestGetValue for NumeratorMetric { + type Output = Rate; + /// **Exported for test purposes.** /// /// Gets the currently stored value as a pair of integers. diff --git a/glean-core/src/metrics/object.rs b/glean-core/src/metrics/object.rs index ca89b293f9..e2eba783cc 100644 --- a/glean-core/src/metrics/object.rs +++ b/glean-core/src/metrics/object.rs @@ -151,7 +151,9 @@ impl ObjectMetric { } } -impl TestGetValue for ObjectMetric { +impl TestGetValue for ObjectMetric { + type Output = JsonValue; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as JSON. diff --git a/glean-core/src/metrics/quantity.rs b/glean-core/src/metrics/quantity.rs index 90296469bb..374ff2d663 100644 --- a/glean-core/src/metrics/quantity.rs +++ b/glean-core/src/metrics/quantity.rs @@ -152,7 +152,9 @@ impl QuantityMetric { } } -impl TestGetValue for QuantityMetric { +impl TestGetValue for QuantityMetric { + type Output = i64; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as an integer. diff --git a/glean-core/src/metrics/rate.rs b/glean-core/src/metrics/rate.rs index 3a15fe9d6e..53b1553b59 100644 --- a/glean-core/src/metrics/rate.rs +++ b/glean-core/src/metrics/rate.rs @@ -178,7 +178,9 @@ impl RateMetric { } } -impl TestGetValue for RateMetric { +impl TestGetValue for RateMetric { + type Output = Rate; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as a pair of integers. diff --git a/glean-core/src/metrics/string.rs b/glean-core/src/metrics/string.rs index aa98978e18..3a1c550fce 100644 --- a/glean-core/src/metrics/string.rs +++ b/glean-core/src/metrics/string.rs @@ -127,7 +127,9 @@ impl StringMetric { } } -impl TestGetValue for StringMetric { +impl TestGetValue for StringMetric { + type Output = String; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as a string. diff --git a/glean-core/src/metrics/string_list.rs b/glean-core/src/metrics/string_list.rs index b4ed3a6311..6bc97c3b33 100644 --- a/glean-core/src/metrics/string_list.rs +++ b/glean-core/src/metrics/string_list.rs @@ -186,7 +186,9 @@ impl StringListMetric { } } -impl TestGetValue> for StringListMetric { +impl TestGetValue for StringListMetric { + type Output = Vec; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently-stored values. diff --git a/glean-core/src/metrics/text.rs b/glean-core/src/metrics/text.rs index e32c6d4815..1cb984fea4 100644 --- a/glean-core/src/metrics/text.rs +++ b/glean-core/src/metrics/text.rs @@ -131,7 +131,9 @@ impl TextMetric { } } -impl TestGetValue for TextMetric { +impl TestGetValue for TextMetric { + type Output = String; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as a string. diff --git a/glean-core/src/metrics/timespan.rs b/glean-core/src/metrics/timespan.rs index 2ac7e90d0b..7928a48ef6 100644 --- a/glean-core/src/metrics/timespan.rs +++ b/glean-core/src/metrics/timespan.rs @@ -285,7 +285,8 @@ impl TimespanMetric { } } -impl TestGetValue for TimespanMetric { +impl TestGetValue for TimespanMetric { + type Output = i64; /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as an integer. diff --git a/glean-core/src/metrics/timing_distribution.rs b/glean-core/src/metrics/timing_distribution.rs index 6434aa746f..442094b156 100644 --- a/glean-core/src/metrics/timing_distribution.rs +++ b/glean-core/src/metrics/timing_distribution.rs @@ -613,7 +613,9 @@ impl TimingDistributionMetric { } } -impl TestGetValue for TimingDistributionMetric { +impl TestGetValue for TimingDistributionMetric { + type Output = DistributionData; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as an integer. diff --git a/glean-core/src/metrics/url.rs b/glean-core/src/metrics/url.rs index 3b0520df9c..8a474b6d1c 100644 --- a/glean-core/src/metrics/url.rs +++ b/glean-core/src/metrics/url.rs @@ -146,7 +146,9 @@ impl UrlMetric { } } -impl TestGetValue for UrlMetric { +impl TestGetValue for UrlMetric { + type Output = String; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as a string. diff --git a/glean-core/src/metrics/uuid.rs b/glean-core/src/metrics/uuid.rs index 4ddf9e3daa..f40f5f6b8e 100644 --- a/glean-core/src/metrics/uuid.rs +++ b/glean-core/src/metrics/uuid.rs @@ -145,7 +145,9 @@ impl UuidMetric { } } -impl TestGetValue for UuidMetric { +impl TestGetValue for UuidMetric { + type Output = String; + /// **Test-only API (exported for FFI purposes).** /// /// Gets the currently stored value as a string. diff --git a/glean-core/src/traits/boolean.rs b/glean-core/src/traits/boolean.rs index 5a9c5a1a79..9e37ea8c18 100644 --- a/glean-core/src/traits/boolean.rs +++ b/glean-core/src/traits/boolean.rs @@ -8,7 +8,7 @@ use crate::{ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait Boolean: TestGetValue { +pub trait Boolean: TestGetValue { /// Sets to the specified boolean value. /// /// # Arguments diff --git a/glean-core/src/traits/counter.rs b/glean-core/src/traits/counter.rs index 00ffd0491f..753b37b223 100644 --- a/glean-core/src/traits/counter.rs +++ b/glean-core/src/traits/counter.rs @@ -8,7 +8,7 @@ use crate::{ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait Counter: TestGetValue { +pub trait Counter: TestGetValue { /// Increases the counter by `amount`. /// /// # Arguments diff --git a/glean-core/src/traits/custom_distribution.rs b/glean-core/src/traits/custom_distribution.rs index 53926bd56f..767f6b7ec9 100644 --- a/glean-core/src/traits/custom_distribution.rs +++ b/glean-core/src/traits/custom_distribution.rs @@ -9,7 +9,7 @@ use crate::{DistributionData, ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait CustomDistribution: TestGetValue { +pub trait CustomDistribution: TestGetValue { /// Accumulates the provided signed samples in the metric. /// /// This is required so that the platform-specific code can provide us with diff --git a/glean-core/src/traits/datetime.rs b/glean-core/src/traits/datetime.rs index fd39d90722..46438efe83 100644 --- a/glean-core/src/traits/datetime.rs +++ b/glean-core/src/traits/datetime.rs @@ -10,7 +10,7 @@ use crate::{ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait Datetime: TestGetValue { +pub trait Datetime: TestGetValue { /// Sets the metric to a date/time which including the timezone offset. /// /// # Arguments diff --git a/glean-core/src/traits/dual_labeled_counter.rs b/glean-core/src/traits/dual_labeled_counter.rs index e5eff6d5c1..bdeafbf9b3 100644 --- a/glean-core/src/traits/dual_labeled_counter.rs +++ b/glean-core/src/traits/dual_labeled_counter.rs @@ -9,7 +9,7 @@ use std::collections::HashMap; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait DualLabeledCounter: TestGetValue>> { +pub trait DualLabeledCounter: TestGetValue>> { /// Gets a specific counter for a given key/category pair. /// /// If a set of acceptable keys or categorires were specified in the `metrics.yaml` file, diff --git a/glean-core/src/traits/event.rs b/glean-core/src/traits/event.rs index bef12f064f..75e551bc02 100644 --- a/glean-core/src/traits/event.rs +++ b/glean-core/src/traits/event.rs @@ -76,7 +76,7 @@ impl TryFrom<&str> for NoExtraKeys { /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait Event: TestGetValue> { +pub trait Event: TestGetValue> { /// The type of the allowed extra keys for this event. type Extra: ExtraKeys; diff --git a/glean-core/src/traits/memory_distribution.rs b/glean-core/src/traits/memory_distribution.rs index 948b729690..6ec2f5c09b 100644 --- a/glean-core/src/traits/memory_distribution.rs +++ b/glean-core/src/traits/memory_distribution.rs @@ -10,7 +10,7 @@ use crate::{ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait MemoryDistribution: TestGetValue { +pub trait MemoryDistribution: TestGetValue { /// Accumulates the provided sample in the metric. /// /// # Arguments diff --git a/glean-core/src/traits/numerator.rs b/glean-core/src/traits/numerator.rs index 3a16bebc75..1e4eaa937d 100644 --- a/glean-core/src/traits/numerator.rs +++ b/glean-core/src/traits/numerator.rs @@ -8,7 +8,7 @@ use crate::{ErrorType, TestGetValue}; // When changing this trait, ensure all operations are implemented in the // related type in `../metrics`. (Except test_get_num_errors) /// A description for the `NumeratorMetric` subtype of the [`RateMetric`](crate::metrics::RateMetric) type. -pub trait Numerator: TestGetValue { +pub trait Numerator: TestGetValue { /// Increases the numerator by `amount`. /// /// # Arguments diff --git a/glean-core/src/traits/quantity.rs b/glean-core/src/traits/quantity.rs index 1eca1050f6..359a73f11b 100644 --- a/glean-core/src/traits/quantity.rs +++ b/glean-core/src/traits/quantity.rs @@ -8,7 +8,7 @@ use crate::{ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait Quantity: TestGetValue { +pub trait Quantity: TestGetValue { /// Sets the value. Must be non-negative. /// /// # Arguments diff --git a/glean-core/src/traits/rate.rs b/glean-core/src/traits/rate.rs index 4c8b8b3c81..dcf5a69f14 100644 --- a/glean-core/src/traits/rate.rs +++ b/glean-core/src/traits/rate.rs @@ -7,7 +7,7 @@ use crate::{ErrorType, TestGetValue}; // When changing this trait, ensure all operations are implemented in the // related type in `../metrics`. (Except test_get_num_errors) /// A description for the [`RateMetric`](crate::metrics::RateMetric) type. -pub trait Rate: TestGetValue { +pub trait Rate: TestGetValue { /// Increases the numerator by `amount`. /// /// # Arguments diff --git a/glean-core/src/traits/string.rs b/glean-core/src/traits/string.rs index 44c5809af2..d8e28b68d9 100644 --- a/glean-core/src/traits/string.rs +++ b/glean-core/src/traits/string.rs @@ -8,7 +8,7 @@ use crate::{ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait String: TestGetValue { +pub trait String: TestGetValue { /// Sets to the specified value. /// /// # Arguments diff --git a/glean-core/src/traits/string_list.rs b/glean-core/src/traits/string_list.rs index 12dbbb50c6..6a8db093af 100644 --- a/glean-core/src/traits/string_list.rs +++ b/glean-core/src/traits/string_list.rs @@ -8,7 +8,7 @@ use crate::{ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait StringList: TestGetValue> { +pub trait StringList: TestGetValue> { /// Adds a new string to the list. /// /// # Arguments diff --git a/glean-core/src/traits/text.rs b/glean-core/src/traits/text.rs index b9845976d9..5f575d45b9 100644 --- a/glean-core/src/traits/text.rs +++ b/glean-core/src/traits/text.rs @@ -8,7 +8,7 @@ use crate::{ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait Text: TestGetValue { +pub trait Text: TestGetValue { /// Sets to the specified value. /// /// # Arguments diff --git a/glean-core/src/traits/timespan.rs b/glean-core/src/traits/timespan.rs index 77ecb3c3cf..50df6621ce 100644 --- a/glean-core/src/traits/timespan.rs +++ b/glean-core/src/traits/timespan.rs @@ -9,7 +9,7 @@ use std::time::Duration; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait Timespan: TestGetValue { +pub trait Timespan: TestGetValue { /// Starts tracking time for the provided metric. /// /// This uses an internal monotonic timer. diff --git a/glean-core/src/traits/timing_distribution.rs b/glean-core/src/traits/timing_distribution.rs index c6d808b696..d1407c1490 100644 --- a/glean-core/src/traits/timing_distribution.rs +++ b/glean-core/src/traits/timing_distribution.rs @@ -12,7 +12,7 @@ use std::time::Duration; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait TimingDistribution: TestGetValue { +pub trait TimingDistribution: TestGetValue { /// Start tracking time for the provided metric. /// Multiple timers can run simultaneously. /// diff --git a/glean-core/src/traits/url.rs b/glean-core/src/traits/url.rs index dc6e1cd6da..88b4060876 100644 --- a/glean-core/src/traits/url.rs +++ b/glean-core/src/traits/url.rs @@ -8,7 +8,7 @@ use crate::{ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait Url: TestGetValue { +pub trait Url: TestGetValue { /// Sets to the specified stringified URL. /// /// # Arguments diff --git a/glean-core/src/traits/uuid.rs b/glean-core/src/traits/uuid.rs index bebcd9cbcd..3ca6da92c6 100644 --- a/glean-core/src/traits/uuid.rs +++ b/glean-core/src/traits/uuid.rs @@ -8,7 +8,7 @@ use crate::{ErrorType, TestGetValue}; /// /// When changing this trait, make sure all the operations are /// implemented in the related type in `../metrics/`. -pub trait Uuid: TestGetValue { +pub trait Uuid: TestGetValue { /// Sets to the specified value. /// /// # Arguments