summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2025-10-15 15:27:40 +0200
committerHampusM <hampus@hampusmat.com>2025-10-15 15:27:40 +0200
commit6ed1d5a9b0723049a15dc7896e34e5cd650f62c7 (patch)
treeda5c1f3fb08622170d82523d5e28a15e43f006f6
parenta1816f82c2d5c18cfd3282047632959028685a45 (diff)
refactor(ecs): shorten insert_at_partition_point_by_key fn name
-rw-r--r--ecs/src/component/storage.rs11
-rw-r--r--ecs/src/event.rs4
-rw-r--r--ecs/src/util.rs4
3 files changed, 9 insertions, 10 deletions
diff --git a/ecs/src/component/storage.rs b/ecs/src/component/storage.rs
index 4ec5222..86e124f 100644
--- a/ecs/src/component/storage.rs
+++ b/ecs/src/component/storage.rs
@@ -642,10 +642,10 @@ impl<'component_storage> Iterator for ArchetypeRefIter<'component_storage, '_>
let mut add_edge_archetype_comps =
archetype.component_ids_sorted().collect::<Vec<_>>();
- add_edge_archetype_comps.insert_at_partition_point_by_key(
- add_edge_component_id,
- |comp_id| *comp_id,
- );
+ add_edge_archetype_comps
+ .insert_at_part_pt_by_key(add_edge_component_id, |comp_id| {
+ *comp_id
+ });
self.storage.imaginary_archetypes.borrow_mut().push(
ImaginaryArchetype {
@@ -712,8 +712,7 @@ impl ArchetypeRefIter<'_, '_>
let mut add_edge_comp_ids = imaginary_archetype_comps.to_vec();
- add_edge_comp_ids
- .insert_at_partition_point_by_key(unique_comp_id, |id| *id);
+ add_edge_comp_ids.insert_at_part_pt_by_key(unique_comp_id, |id| *id);
let add_edge = ArchetypeId::new(&add_edge_comp_ids);
diff --git a/ecs/src/event.rs b/ecs/src/event.rs
index fc3a58b..dffd327 100644
--- a/ecs/src/event.rs
+++ b/ecs/src/event.rs
@@ -68,7 +68,7 @@ impl NewEvents
return;
}
- self.events.insert_at_partition_point_by_key(
+ self.events.insert_at_part_pt_by_key(
(event_id, Matches { match_ids: Vec::from([match_id]) }),
|(other_event_id, _)| *other_event_id,
);
@@ -100,6 +100,6 @@ impl Matches
}
self.match_ids
- .insert_at_partition_point_by_key(match_id, |other_match_id| *other_match_id);
+ .insert_at_part_pt_by_key(match_id, |other_match_id| *other_match_id);
}
}
diff --git a/ecs/src/util.rs b/ecs/src/util.rs
index 2ab78cd..dc670e7 100644
--- a/ecs/src/util.rs
+++ b/ecs/src/util.rs
@@ -8,7 +8,7 @@ pub(crate) mod array_vec;
pub trait VecExt<Item>
{
- fn insert_at_partition_point_by_key<Key>(
+ fn insert_at_part_pt_by_key<Key>(
&mut self,
item: Item,
func: impl FnMut(&Item) -> Key,
@@ -18,7 +18,7 @@ pub trait VecExt<Item>
impl<Item> VecExt<Item> for Vec<Item>
{
- fn insert_at_partition_point_by_key<Key>(
+ fn insert_at_part_pt_by_key<Key>(
&mut self,
item: Item,
mut func: impl FnMut(&Item) -> Key,