Skip to content

Commit

Permalink
test order
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean Karn committed Nov 12, 2021
1 parent 0992b44 commit 09c5892
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,25 +234,25 @@ impl Map<String, Value> {
}
}

#[cfg(all(feature = "preserve_order", not(no_btreemap_remove_entry)))]
/// Retains only the elements specified by the predicate.
///
/// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`.
/// The elements are visited in ascending key order.
#[inline]
#[cfg(all(feature = "preserve_order", not(no_btreemap_remove_entry)))]
pub fn retain<F, K>(&mut self, f: F)
where
F: FnMut(&String, &mut Value) -> bool,
{
self.map.retain(f);
}

#[cfg(not(feature = "preserve_order"))]
/// Retains only the elements specified by the predicate.
///
/// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`.
/// The elements are visited in ascending key order.
#[inline]
#[cfg(not(feature = "preserve_order"))]
pub fn retain<F>(&mut self, f: F)
where
F: FnMut(&String, &mut Value) -> bool,
Expand Down

0 comments on commit 09c5892

Please sign in to comment.