tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit ff9f9beb791e37ffb80389745e3eeed48a6fc99d
parent de99d7d9e933d9109f30ae0e83fbd7ad96602141
Author: Jan-Erik Rediger <jrediger@mozilla.com>
Date:   Fri, 24 Oct 2025 12:39:28 +0000

Bug 1991891 - Adopt new associated type of TestGetValue r=TravisLong

Differential Revision: https://phabricator.services.mozilla.com/D269372

Diffstat:
Mtoolkit/components/glean/api/src/private/boolean.rs | 4+++-
Mtoolkit/components/glean/api/src/private/counter.rs | 4+++-
Mtoolkit/components/glean/api/src/private/custom_distribution.rs | 4+++-
Mtoolkit/components/glean/api/src/private/datetime.rs | 4+++-
Mtoolkit/components/glean/api/src/private/denominator.rs | 4+++-
Mtoolkit/components/glean/api/src/private/dual_labeled_counter_sub.rs | 4+++-
Mtoolkit/components/glean/api/src/private/event.rs | 4+++-
Mtoolkit/components/glean/api/src/private/labeled_boolean.rs | 4+++-
Mtoolkit/components/glean/api/src/private/labeled_counter.rs | 4+++-
Mtoolkit/components/glean/api/src/private/labeled_custom_distribution.rs | 4+++-
Mtoolkit/components/glean/api/src/private/labeled_memory_distribution.rs | 4+++-
Mtoolkit/components/glean/api/src/private/labeled_timing_distribution.rs | 4+++-
Mtoolkit/components/glean/api/src/private/memory_distribution.rs | 4+++-
Mtoolkit/components/glean/api/src/private/numerator.rs | 4+++-
Mtoolkit/components/glean/api/src/private/object.rs | 4+++-
Mtoolkit/components/glean/api/src/private/quantity.rs | 4+++-
Mtoolkit/components/glean/api/src/private/rate.rs | 4+++-
Mtoolkit/components/glean/api/src/private/string.rs | 4+++-
Mtoolkit/components/glean/api/src/private/string_list.rs | 4+++-
Mtoolkit/components/glean/api/src/private/text.rs | 4+++-
Mtoolkit/components/glean/api/src/private/timespan.rs | 4+++-
Mtoolkit/components/glean/api/src/private/timing_distribution.rs | 4+++-
Mtoolkit/components/glean/api/src/private/url.rs | 4+++-
Mtoolkit/components/glean/api/src/private/uuid.rs | 4+++-
24 files changed, 72 insertions(+), 24 deletions(-)

diff --git a/toolkit/components/glean/api/src/private/boolean.rs b/toolkit/components/glean/api/src/private/boolean.rs @@ -151,7 +151,9 @@ impl Boolean for BooleanMetric { } #[inherent] -impl glean::TestGetValue<bool> for BooleanMetric { +impl glean::TestGetValue for BooleanMetric { + type Output = bool; + /// **Test-only API.** /// /// Get the currently stored value as a boolean. diff --git a/toolkit/components/glean/api/src/private/counter.rs b/toolkit/components/glean/api/src/private/counter.rs @@ -188,7 +188,9 @@ impl Counter for CounterMetric { } #[inherent] -impl glean::TestGetValue<i32> for CounterMetric { +impl glean::TestGetValue for CounterMetric { + type Output = i32; + /// **Test-only API.** /// /// Get the currently stored value as an integer. diff --git a/toolkit/components/glean/api/src/private/custom_distribution.rs b/toolkit/components/glean/api/src/private/custom_distribution.rs @@ -199,7 +199,9 @@ impl CustomDistribution for CustomDistributionMetric { } #[inherent] -impl glean::TestGetValue<DistributionData> for CustomDistributionMetric { +impl glean::TestGetValue for CustomDistributionMetric { + type Output = DistributionData; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<DistributionData> { match self { CustomDistributionMetric::Parent { inner, .. } => inner.test_get_value(ping_name), diff --git a/toolkit/components/glean/api/src/private/datetime.rs b/toolkit/components/glean/api/src/private/datetime.rs @@ -295,7 +295,9 @@ impl Datetime for DatetimeMetric { } #[inherent] -impl glean::TestGetValue<glean::Datetime> for DatetimeMetric { +impl glean::TestGetValue for DatetimeMetric { + type Output = glean::Datetime; + /// **Exported for test purposes.** /// /// Gets the currently stored value as a Datetime. diff --git a/toolkit/components/glean/api/src/private/denominator.rs b/toolkit/components/glean/api/src/private/denominator.rs @@ -117,7 +117,9 @@ impl Counter for DenominatorMetric { } #[inherent] -impl glean::TestGetValue<i32> for DenominatorMetric { +impl glean::TestGetValue for DenominatorMetric { + type Output = i32; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<i32> { match self { DenominatorMetric::Parent { inner, .. } => inner.test_get_value(ping_name), diff --git a/toolkit/components/glean/api/src/private/dual_labeled_counter_sub.rs b/toolkit/components/glean/api/src/private/dual_labeled_counter_sub.rs @@ -107,7 +107,9 @@ impl Counter for DualLabeledCounterSubMetric { } #[inherent] -impl glean::TestGetValue<i32> for DualLabeledCounterSubMetric { +impl glean::TestGetValue for DualLabeledCounterSubMetric { + type Output = i32; + /// **Test-only API.** /// /// Get the currently stored value as an integer. diff --git a/toolkit/components/glean/api/src/private/event.rs b/toolkit/components/glean/api/src/private/event.rs @@ -212,7 +212,9 @@ impl<K: 'static + ExtraKeys + Send + Sync + Clone> Event for EventMetric<K> { } #[inherent] -impl<K> glean::TestGetValue<Vec<RecordedEvent>> for EventMetric<K> { +impl<K> glean::TestGetValue for EventMetric<K> { + type Output = Vec<RecordedEvent>; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<Vec<RecordedEvent>> { match self { EventMetric::Parent { inner, .. } => inner.test_get_value(ping_name), diff --git a/toolkit/components/glean/api/src/private/labeled_boolean.rs b/toolkit/components/glean/api/src/private/labeled_boolean.rs @@ -97,7 +97,9 @@ impl Boolean for LabeledBooleanMetric { } #[inherent] -impl glean::TestGetValue<bool> for LabeledBooleanMetric { +impl glean::TestGetValue for LabeledBooleanMetric { + type Output = bool; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<bool> { match self { LabeledBooleanMetric::Parent(p) => p.test_get_value(ping_name), diff --git a/toolkit/components/glean/api/src/private/labeled_counter.rs b/toolkit/components/glean/api/src/private/labeled_counter.rs @@ -124,7 +124,9 @@ impl Counter for LabeledCounterMetric { } #[inherent] -impl glean::TestGetValue<i32> for LabeledCounterMetric { +impl glean::TestGetValue for LabeledCounterMetric { + type Output = i32; + /// **Test-only API.** /// /// Get the currently stored value as an integer. diff --git a/toolkit/components/glean/api/src/private/labeled_custom_distribution.rs b/toolkit/components/glean/api/src/private/labeled_custom_distribution.rs @@ -125,7 +125,9 @@ impl CustomDistribution for LabeledCustomDistributionMetric { } #[inherent] -impl glean::TestGetValue<DistributionData> for LabeledCustomDistributionMetric { +impl glean::TestGetValue for LabeledCustomDistributionMetric { + type Output = DistributionData; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<DistributionData> { match self { LabeledCustomDistributionMetric::Parent(p) => p.test_get_value(ping_name), diff --git a/toolkit/components/glean/api/src/private/labeled_memory_distribution.rs b/toolkit/components/glean/api/src/private/labeled_memory_distribution.rs @@ -129,7 +129,9 @@ impl MemoryDistribution for LabeledMemoryDistributionMetric { } #[inherent] -impl glean::TestGetValue<DistributionData> for LabeledMemoryDistributionMetric { +impl glean::TestGetValue for LabeledMemoryDistributionMetric { + type Output = DistributionData; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<DistributionData> { match self { LabeledMemoryDistributionMetric::Parent(p) => p.test_get_value(ping_name), diff --git a/toolkit/components/glean/api/src/private/labeled_timing_distribution.rs b/toolkit/components/glean/api/src/private/labeled_timing_distribution.rs @@ -372,7 +372,9 @@ impl TimingDistribution for LabeledTimingDistributionMetric { } #[inherent] -impl glean::TestGetValue<DistributionData> for LabeledTimingDistributionMetric { +impl glean::TestGetValue for LabeledTimingDistributionMetric { + type Output = DistributionData; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<DistributionData> { self.inner.test_get_value(ping_name) } diff --git a/toolkit/components/glean/api/src/private/memory_distribution.rs b/toolkit/components/glean/api/src/private/memory_distribution.rs @@ -222,7 +222,9 @@ impl MemoryDistribution for MemoryDistributionMetric { } #[inherent] -impl glean::TestGetValue<DistributionData> for MemoryDistributionMetric { +impl glean::TestGetValue for MemoryDistributionMetric { + type Output = DistributionData; + /// **Test-only API.** /// /// Get the currently-stored histogram as a DistributionData of the serialized value. diff --git a/toolkit/components/glean/api/src/private/numerator.rs b/toolkit/components/glean/api/src/private/numerator.rs @@ -113,7 +113,9 @@ impl Numerator for NumeratorMetric { } #[inherent] -impl glean::TestGetValue<Rate> for NumeratorMetric { +impl glean::TestGetValue for NumeratorMetric { + type Output = Rate; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<Rate> { match self { NumeratorMetric::Parent { inner, .. } => inner.test_get_value(ping_name), diff --git a/toolkit/components/glean/api/src/private/object.rs b/toolkit/components/glean/api/src/private/object.rs @@ -167,7 +167,9 @@ impl<K: ObjectSerialize + Clone> ObjectMetric<K> { } #[inherent] -impl<K> glean::TestGetValue<serde_json::Value> for ObjectMetric<K> { +impl<K> glean::TestGetValue for ObjectMetric<K> { + type Output = serde_json::Value; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<serde_json::Value> { match self { ObjectMetric::Parent { inner, .. } => inner.test_get_value(ping_name), diff --git a/toolkit/components/glean/api/src/private/quantity.rs b/toolkit/components/glean/api/src/private/quantity.rs @@ -116,7 +116,9 @@ impl Quantity for QuantityMetric { } #[inherent] -impl glean::TestGetValue<i64> for QuantityMetric { +impl glean::TestGetValue for QuantityMetric { + type Output = i64; + /// **Test-only API.** /// /// Get the currently stored value. diff --git a/toolkit/components/glean/api/src/private/rate.rs b/toolkit/components/glean/api/src/private/rate.rs @@ -146,7 +146,9 @@ impl Rate for RateMetric { } #[inherent] -impl glean::TestGetValue<glean::Rate> for RateMetric { +impl glean::TestGetValue for RateMetric { + type Output = glean::Rate; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<glean::Rate> { match self { RateMetric::Parent { inner, .. } => inner.test_get_value(ping_name), diff --git a/toolkit/components/glean/api/src/private/string.rs b/toolkit/components/glean/api/src/private/string.rs @@ -134,7 +134,9 @@ impl glean::traits::String for StringMetric { } #[inherent] -impl glean::TestGetValue<std::string::String> for StringMetric { +impl glean::TestGetValue for StringMetric { + type Output = std::string::String; + /// **Exported for test purposes.** /// /// Gets the currently stored value as a string. diff --git a/toolkit/components/glean/api/src/private/string_list.rs b/toolkit/components/glean/api/src/private/string_list.rs @@ -156,7 +156,9 @@ impl StringList for StringListMetric { } #[inherent] -impl glean::TestGetValue<Vec<String>> for StringListMetric { +impl glean::TestGetValue for StringListMetric { + type Output = Vec<String>; + /// **Test-only API.** /// /// Get the currently stored values. diff --git a/toolkit/components/glean/api/src/private/text.rs b/toolkit/components/glean/api/src/private/text.rs @@ -133,7 +133,9 @@ impl glean::traits::Text for TextMetric { } #[inherent] -impl glean::TestGetValue<std::string::String> for TextMetric { +impl glean::TestGetValue for TextMetric { + type Output = std::string::String; + /// **Exported for test purposes.** /// /// Gets the currently stored value as a string. diff --git a/toolkit/components/glean/api/src/private/timespan.rs b/toolkit/components/glean/api/src/private/timespan.rs @@ -292,7 +292,9 @@ impl Timespan for TimespanMetric { } #[inherent] -impl glean::TestGetValue<u64> for TimespanMetric { +impl glean::TestGetValue for TimespanMetric { + type Output = u64; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<u64> { match self { // Conversion is ok here: diff --git a/toolkit/components/glean/api/src/private/timing_distribution.rs b/toolkit/components/glean/api/src/private/timing_distribution.rs @@ -808,7 +808,9 @@ impl TimingDistribution for TimingDistributionMetric { } #[inherent] -impl glean::TestGetValue<DistributionData> for TimingDistributionMetric { +impl glean::TestGetValue for TimingDistributionMetric { + type Output = DistributionData; + /// **Exported for test purposes.** /// /// Gets the currently stored value of the metric. diff --git a/toolkit/components/glean/api/src/private/url.rs b/toolkit/components/glean/api/src/private/url.rs @@ -144,7 +144,9 @@ impl glean::traits::Url for UrlMetric { } #[inherent] -impl glean::TestGetValue<std::string::String> for UrlMetric { +impl glean::TestGetValue for UrlMetric { + type Output = std::string::String; + pub fn test_get_value(&self, ping_name: Option<String>) -> Option<std::string::String> { match self { UrlMetric::Parent { inner, .. } => inner.test_get_value(ping_name), diff --git a/toolkit/components/glean/api/src/private/uuid.rs b/toolkit/components/glean/api/src/private/uuid.rs @@ -143,7 +143,9 @@ impl glean::traits::Uuid for UuidMetric { } #[inherent] -impl glean::TestGetValue<Uuid> for UuidMetric { +impl glean::TestGetValue for UuidMetric { + type Output = Uuid; + /// **Test-only API.** /// /// Get the stored UUID value.