From 6cfecad866969d2c1bea4df3b7445e9672fb53cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Bary=C5=82a?= Date: Tue, 23 Jun 2026 10:58:00 +0200 Subject: [PATCH] QuantileResult: Add into_entries This allows users to consume the result, and, for example, perform iterator transformations without needing to borrow from the original result. --- src/quantile.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/quantile.rs b/src/quantile.rs index bf6c7e4..1556e86 100644 --- a/src/quantile.rs +++ b/src/quantile.rs @@ -134,6 +134,13 @@ impl QuantilesResult { &self.entries } + /// Returns the quantile-to-bucket mappings, sorted by quantile. + /// + /// Consumes self, returning the mapping by value instead of reference. + pub fn into_entries(self) -> BTreeMap { + self.entries + } + /// Look up the bucket for a specific quantile. pub fn get(&self, quantile: &Quantile) -> Option<&Bucket> { self.entries.get(quantile)