Added
Link Here
|
1 |
Comply with rust-lang/rfcs#2140 |
2 |
https://github.com/rust-lang/rfcs/issues/2140 |
3 |
|
4 |
--- common/systems/src/mount.rs.orig 2023-09-05 08:33:57.917799000 +0200 |
5 |
+++ common/systems/src/mount.rs 2023-09-05 08:36:25.244098000 +0200 |
6 |
@@ -61,7 +61,7 @@ impl<'a> System<'a> for Sys { |
7 |
.map(|c| ( |
8 |
// Only take inputs and actions from the rider if the mount is not intelligent (TODO: expand the definition of 'intelligent'). |
9 |
if !matches!(body, Some(Body::Humanoid(_))) { |
10 |
- let actions = c.actions.drain_filter(|action| match action { |
11 |
+ let actions = c.actions.extract_if(|action| match action { |
12 |
ControlAction::StartInput { input: i, .. } |
13 |
| ControlAction::CancelInput(i) => matches!(i, InputKind::Jump | InputKind::Fly | InputKind::Roll), |
14 |
_ => false |
15 |
@@ -151,7 +151,7 @@ impl<'a> System<'a> for Sys { |
16 |
let inputs = controllers.get_mut(entity).map(|c| { |
17 |
let actions: Vec<_> = c |
18 |
.actions |
19 |
- .drain_filter(|action| match action { |
20 |
+ .extract_if(|action| match action { |
21 |
ControlAction::StartInput { input: i, .. } |
22 |
| ControlAction::CancelInput(i) => { |
23 |
matches!(i, InputKind::Jump | InputKind::Fly | InputKind::Roll) |
24 |
--- common/systems/src/lib.rs.orig 2023-09-05 08:33:14.168102000 +0200 |
25 |
+++ common/systems/src/lib.rs 2023-09-05 08:33:25.834926000 +0200 |
26 |
@@ -1,4 +1,4 @@ |
27 |
-#![feature(drain_filter, let_chains)] |
28 |
+#![feature(extract_if, let_chains)] |
29 |
#![allow(clippy::option_map_unit_fn)] |
30 |
|
31 |
mod aura; |
32 |
--- common/src/lib.rs.orig 2023-09-05 08:27:02.430168000 +0200 |
33 |
+++ common/src/lib.rs 2023-09-05 08:27:12.840524000 +0200 |
34 |
@@ -14,7 +14,7 @@ |
35 |
arbitrary_self_types, |
36 |
int_roundings |
37 |
)] |
38 |
-#![feature(hash_drain_filter)] |
39 |
+#![feature(hash_extract_if)] |
40 |
|
41 |
pub use common_assets as assets; |
42 |
pub use uuid; |
43 |
--- network/protocol/src/quic.rs.orig 2023-09-05 08:30:57.788439000 +0200 |
44 |
+++ network/protocol/src/quic.rs 2023-09-05 08:39:54.845952000 +0200 |
45 |
@@ -388,7 +388,7 @@ where |
46 |
// try to order pending |
47 |
let mut pending_violated = false; |
48 |
let mut reliable = vec![]; |
49 |
- self.pending_reliable_buffers.drain_filter(|(_, buffer)| { |
50 |
+ self.pending_reliable_buffers.extract_if(|(_, buffer)| { |
51 |
// try to get Sid without touching buffer |
52 |
let mut testbuffer = buffer.clone(); |
53 |
match ITFrame::read_frame(&mut testbuffer) { |
54 |
--- network/protocol/src/lib.rs.orig 2023-09-05 08:30:10.685261000 +0200 |
55 |
+++ network/protocol/src/lib.rs 2023-09-05 08:30:46.426039000 +0200 |
56 |
@@ -1,4 +1,4 @@ |
57 |
-#![feature(drain_filter)] |
58 |
+#![feature(extract_if)] |
59 |
//! Network Protocol |
60 |
//! |
61 |
//! a I/O-Free protocol for the veloren network crate. |
62 |
--- server/src/persistence/character_updater.rs.orig 2023-09-05 08:37:55.535451000 +0200 |
63 |
+++ server/src/persistence/character_updater.rs 2023-09-05 08:38:15.126505000 +0200 |
64 |
@@ -267,7 +267,7 @@ impl CharacterUpdater { |
65 |
} |
66 |
|
67 |
pub fn process_batch_completion(&mut self, completed_batch_id: u64) { |
68 |
- self.pending_database_actions.drain_filter(|_, event| { |
69 |
+ self.pending_database_actions.extract_if(|_, event| { |
70 |
matches!(event, DatabaseAction::Submitted { |
71 |
batch_id, |
72 |
} if completed_batch_id == *batch_id) |
73 |
--- server/src/lib.rs.orig 2023-09-05 08:37:33.129297000 +0200 |
74 |
+++ server/src/lib.rs 2023-09-05 08:40:23.982003000 +0200 |
75 |
@@ -3,13 +3,13 @@ |
76 |
#![deny(clippy::clone_on_ref_ptr)] |
77 |
#![feature( |
78 |
box_patterns, |
79 |
- drain_filter, |
80 |
+ extract_if, |
81 |
let_chains, |
82 |
never_type, |
83 |
option_zip, |
84 |
unwrap_infallible |
85 |
)] |
86 |
-#![feature(hash_drain_filter)] |
87 |
+#![feature(hash_extract_if)] |
88 |
|
89 |
pub mod automod; |
90 |
mod character_creator; |
91 |
--- voxygen/src/lib.rs.orig 2023-09-05 08:41:11.688447000 +0200 |
92 |
+++ voxygen/src/lib.rs 2023-09-05 08:41:21.838058000 +0200 |
93 |
@@ -5,7 +5,7 @@ |
94 |
#![feature( |
95 |
array_methods, |
96 |
array_zip, |
97 |
- drain_filter, |
98 |
+ extract_if, |
99 |
trait_alias, |
100 |
option_get_or_insert_default, |
101 |
map_try_insert, |
102 |
--- voxygen/src/scene/mod.rs.orig 2023-09-05 08:47:16.999196000 +0200 |
103 |
+++ voxygen/src/scene/mod.rs 2023-09-05 08:47:23.905291000 +0200 |
104 |
@@ -763,7 +763,7 @@ impl Scene { |
105 |
renderer.update_consts(&mut self.data.lights, lights); |
106 |
|
107 |
// Update event lights |
108 |
- self.event_lights.drain_filter(|el| { |
109 |
+ self.event_lights.extract_if(|el| { |
110 |
el.timeout -= dt; |
111 |
el.timeout <= 0.0 |
112 |
}); |
113 |
--- voxygen/src/scene/math.rs.orig 2023-09-05 08:46:56.195615000 +0200 |
114 |
+++ voxygen/src/scene/math.rs 2023-09-05 08:47:06.240539000 +0200 |
115 |
@@ -250,7 +250,7 @@ pub fn clip_object_by_plane<T: Float + MulAdd<T, T, Ou |
116 |
tolerance: T, |
117 |
) { |
118 |
let mut intersection_points = Vec::new(); |
119 |
- polys.drain_filter(|points| { |
120 |
+ polys.extract_if(|points| { |
121 |
let len = intersection_points.len(); |
122 |
let outside_first = clip_points_by_plane(points, plane, &mut intersection_points); |
123 |
// Only remember intersections that are not coplanar with this side; i.e. those |