Rich-T-kid commented on code in PR #10695:
URL: https://github.com/apache/arrow-rs/pull/10695#discussion_r3789599853
##########
arrow-schema/src/metadata.rs:
##########
@@ -146,6 +146,19 @@ impl Metadata {
pub fn values(&self) -> impl Iterator<Item = &String> {
self.iter().map(|(_, value)| value)
}
+
+ /// Retains only the entries for which `f(&key, &mut value)` returns
`true`.
+ ///
+ /// Entries for which `f` returns `false` are removed. Retained entries
+ /// remain in their original (sorted) order.
+ ///
+ /// Clones the underlying map if (and only if) it is shared.
+ pub fn retain<F>(&mut self, eq: F)
+ where
+ F: FnMut(&String, &mut String) -> bool,
+ {
+ Arc::make_mut(self.0.get_or_insert_default()).retain(eq);
Review Comment:
ah good catch!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]