Skip to content

Commit

Permalink
fix: nostd tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ten3roberts committed May 27, 2024
1 parent b0aca59 commit 26008fa
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 66 deletions.
11 changes: 0 additions & 11 deletions src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,6 @@ pub(crate) struct RowValueFormatter<'a> {
pub slot: Slot,
}

struct ComponentName {
base_name: &'static str,
id: ComponentKey,
}

impl Debug for ComponentName {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(f, "{}{}", self.base_name, self.id)
}
}

impl<'a> Debug for RowValueFormatter<'a> {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
let mut map = f.debug_map();
Expand Down
28 changes: 1 addition & 27 deletions src/query/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{
archetype::{Archetype, ArchetypeId, Slice},
fetch::{FetchPrepareData, PreparedFetch},
filter::Filtered,
Entity, Fetch, World,
Fetch, World,
};

use super::{ArchetypeChunks, Chunk};
Expand Down Expand Up @@ -78,29 +78,3 @@ where
})
}
}

struct BatchesWithId<'q, Q: PreparedFetch<'q>, F> {
chunks: ArchetypeChunks<'q, Q, F>,
// The current batch
current: Option<Chunk<'q, Q>>,
}

impl<'q, Q, F> Iterator for BatchesWithId<'q, Q, F>
where
Q: 'q + PreparedFetch<'q>,
F: 'q + PreparedFetch<'q>,
{
type Item = (Entity, Q::Item);

fn next(&mut self) -> Option<Self::Item> {
loop {
if let Some(current) = self.current.as_mut() {
if let item @ Some(_) = current.next_with_id() {
return item;
}
}

self.current = Some(self.chunks.next()?);
}
}
}
4 changes: 2 additions & 2 deletions src/query/planar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ where
/// See: [`QueryBorrow::for_each`]
pub fn try_for_each<E>(
&mut self,
mut func: impl FnMut(<Q as FetchItem<'_>>::Item) -> std::result::Result<(), E> + Send + Sync,
) -> std::result::Result<(), E> {
mut func: impl FnMut(<Q as FetchItem<'_>>::Item) -> core::result::Result<(), E> + Send + Sync,
) -> core::result::Result<(), E> {
self.clear_borrows();
for &arch_id in self.archetypes {
let arch = self.state.world.archetypes.get(arch_id);
Expand Down
13 changes: 0 additions & 13 deletions src/system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,19 +302,6 @@ pub struct System<F, Args, Ret> {
_marker: PhantomData<Ret>,
}

struct FormatWith<F> {
func: F,
}

impl<F> fmt::Debug for FormatWith<F>
where
F: Fn(&mut Formatter<'_>) -> fmt::Result,
{
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
(self.func)(f)
}
}

/// Abstraction over a system with any kind of arguments and fallibility
#[doc(hidden)]
pub trait DynSystem {
Expand Down
14 changes: 1 addition & 13 deletions src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use alloc::vec::Vec;
use itertools::{Either, Itertools};

use crate::{
archetype::{ArchetypeId, CellData, Slice, Slot},
archetype::{CellData, Slice, Slot},
buffer::ComponentBuffer,
component::{ComponentDesc, ComponentValue},
entity::EntityLocation,
Expand Down Expand Up @@ -174,18 +174,6 @@ unsafe impl<W: ComponentUpdater + ComponentPusher> EntityWriter for SingleCompon
}
}

/// # Safety
/// *All* components of the new slot must be initialized
pub(crate) unsafe trait MigrateEntity {
fn migrate(
self,
world: &mut World,
src_id: ArchetypeId,
src_slot: Slot,
tick: u32,
) -> (EntityLocation, Option<(Entity, Slot)>);
}

pub(crate) struct Replace<T: ComponentValue> {
pub(crate) value: T,
}
Expand Down

0 comments on commit 26008fa

Please sign in to comment.