Skip to content

Commit d61452a

Browse files
committed
chore: rename drain_filter to extract_if
sync w/ upstream References: * rust-lang/rust#104455 * rust-lang/rust#70530 Signed-off-by: Renato Westphal <[email protected]>
1 parent 8f364d6 commit d61452a

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

holo-northbound/src/configuration.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ where
663663
// Move to a separate vector the changes that need to be relayed.
664664
let callbacks = P::callbacks().unwrap();
665665
let relayed_changes = changes
666-
.drain_filter(|(cb_key, _)| callbacks.0.get(cb_key).is_none())
666+
.extract_if(|(cb_key, _)| callbacks.0.get(cb_key).is_none())
667667
.collect();
668668

669669
// Process local changes.

holo-northbound/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// See LICENSE for license details.
55
//
66

7-
#![feature(drain_filter)]
7+
#![feature(extract_if)]
88
#![warn(rust_2018_idioms)]
99
#![allow(type_alias_bounds)]
1010
#![allow(clippy::too_many_arguments)]

holo-ospf/src/events.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ where
12661266
// retransmission lists.
12671267
for lse_idx in lsdb
12681268
.maxage_lsas
1269-
.drain_filter(|lse_idx| {
1269+
.extract_if(|lse_idx| {
12701270
let lse = &arenas.lsa_entries[*lse_idx];
12711271
!arenas.neighbors.iter().any(|(_, nbr)| {
12721272
nbr.lists

holo-ospf/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
)]
1212
#![allow(clippy::single_match, clippy::too_many_arguments)]
1313
#![allow(type_alias_bounds)]
14-
#![feature(btree_drain_filter, hash_drain_filter, ip, let_chains, lazy_cell)]
14+
#![feature(btree_extract_if, hash_extract_if, ip, let_chains, lazy_cell)]
1515

1616
pub mod area;
1717
pub mod collections;

holo-ospf/src/route.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub(crate) fn update_rib_partial<V>(
209209
// Check for intra-area changes.
210210
if !partial.intra.is_empty() {
211211
// Remove affected intra-area routes from the RIB.
212-
old_rib.extend(rib.drain_filter(|prefix, route| {
212+
old_rib.extend(rib.extract_if(|prefix, route| {
213213
partial.intra.contains(prefix)
214214
&& route.path_type == PathType::IntraArea
215215
}));
@@ -235,7 +235,7 @@ pub(crate) fn update_rib_partial<V>(
235235
// Check for inter-area changes.
236236
if !partial.inter_network.is_empty() {
237237
// Remove affected inter-area routes from the RIB.
238-
old_rib.extend(rib.drain_filter(|prefix, route| {
238+
old_rib.extend(rib.extract_if(|prefix, route| {
239239
partial.inter_network.contains(prefix)
240240
&& route.path_type == PathType::InterArea
241241
}));
@@ -273,7 +273,7 @@ pub(crate) fn update_rib_partial<V>(
273273
}
274274

275275
// Remove affected inter-area routes from the routers RIB.
276-
area.state.routers.drain_filter(|router_id, route| {
276+
let _ = area.state.routers.extract_if(|router_id, route| {
277277
partial.inter_router.contains(router_id)
278278
&& route.path_type == PathType::InterArea
279279
});
@@ -294,7 +294,7 @@ pub(crate) fn update_rib_partial<V>(
294294
let reevaluate_all = !partial.inter_router.is_empty();
295295

296296
// Remove affected external routes from the RIB.
297-
old_rib.extend(rib.drain_filter(|prefix, route| {
297+
old_rib.extend(rib.extract_if(|prefix, route| {
298298
(reevaluate_all || partial.external.contains(prefix))
299299
&& matches!(
300300
route.path_type,

0 commit comments

Comments
 (0)