Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/Ralith/hecs"
readme = "README.md"
keywords = ["ecs", "entity"]
categories = ["data-structures", "game-engines", "no-std"]
rust-version = "1.65"
rust-version = "1.81"

[package.metadata.docs.rs]
all-features = true
Expand Down
3 changes: 1 addition & 2 deletions src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ pub struct BatchIncomplete {
_opaque: (),
}

#[cfg(feature = "std")]
impl std::error::Error for BatchIncomplete {}
impl core::error::Error for BatchIncomplete {}

impl fmt::Display for BatchIncomplete {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
3 changes: 1 addition & 2 deletions src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ impl fmt::Display for MissingComponent {
}
}

#[cfg(feature = "std")]
impl std::error::Error for MissingComponent {}
impl core::error::Error for MissingComponent {}

macro_rules! tuple_impl {
($($name: ident),*) => {
Expand Down
4 changes: 1 addition & 3 deletions src/entities.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use alloc::vec::Vec;
use core::cmp;
use core::convert::TryFrom;
use core::error::Error;
use core::iter::ExactSizeIterator;
use core::num::{NonZeroU32, NonZeroU64};
use core::ops::Range;
use core::sync::atomic::{AtomicIsize, Ordering};
use core::{fmt, mem};
#[cfg(feature = "std")]
use std::error::Error;

/// Lightweight unique ID, or handle, of an entity
///
Expand Down Expand Up @@ -609,7 +608,6 @@ impl fmt::Display for NoSuchEntity {
}
}

#[cfg(feature = "std")]
impl Error for NoSuchEntity {}

#[derive(Clone)]
Expand Down
11 changes: 3 additions & 8 deletions src/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ use crate::alloc::{vec, vec::Vec};
use core::any::TypeId;
use core::borrow::Borrow;
use core::convert::TryFrom;
use core::error::Error;
use core::hash::{BuildHasherDefault, Hasher};
use spin::Mutex;

use core::{fmt, ptr};

#[cfg(feature = "std")]
use std::error::Error;
use spin::Mutex;

use hashbrown::hash_map::{Entry, HashMap};

Expand Down Expand Up @@ -540,7 +537,7 @@ impl World {
///
/// Returns `true` if `entity` exists and satisfies the query `Q`.
pub fn satisfies<Q: Query>(&self, entity: Entity) -> bool {
self.entity(entity).map_or(false, |e| e.satisfies::<Q>())
self.entity(entity).is_ok_and(|e| e.satisfies::<Q>())
}

/// Access an entity regardless of its component types
Expand Down Expand Up @@ -996,7 +993,6 @@ pub enum ComponentError {
MissingComponent(MissingComponent),
}

#[cfg(feature = "std")]
impl Error for ComponentError {}

impl fmt::Display for ComponentError {
Expand Down Expand Up @@ -1030,7 +1026,6 @@ pub enum QueryOneError {
Unsatisfied,
}

#[cfg(feature = "std")]
impl Error for QueryOneError {}

impl fmt::Display for QueryOneError {
Expand Down