Remove ComponentsError (#3716)
# Objective `ComponentsError` is unused and should be removed. Fixes #3707 ## Solution Remove `ComponentsError`.
This commit is contained in:
parent
e30d600dbf
commit
f1f6fd349a
@ -9,7 +9,6 @@ use std::{
|
|||||||
alloc::Layout,
|
alloc::Layout,
|
||||||
any::{Any, TypeId},
|
any::{Any, TypeId},
|
||||||
};
|
};
|
||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
/// A component is data associated with an [`Entity`](crate::entity::Entity). Each entity can have
|
/// A component is data associated with an [`Entity`](crate::entity::Entity). Each entity can have
|
||||||
/// multiple different types of components, but only one of them per type.
|
/// multiple different types of components, but only one of them per type.
|
||||||
@ -244,16 +243,6 @@ pub struct Components {
|
|||||||
resource_indices: std::collections::HashMap<TypeId, usize, fxhash::FxBuildHasher>,
|
resource_indices: std::collections::HashMap<TypeId, usize, fxhash::FxBuildHasher>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
|
||||||
pub enum ComponentsError {
|
|
||||||
#[error("A component of type {name:?} ({type_id:?}) already exists")]
|
|
||||||
ComponentAlreadyExists {
|
|
||||||
type_id: TypeId,
|
|
||||||
name: String,
|
|
||||||
existing_id: ComponentId,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Components {
|
impl Components {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn init_component<T: Component>(&mut self, storages: &mut Storages) -> ComponentId {
|
pub fn init_component<T: Component>(&mut self, storages: &mut Storages) -> ComponentId {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user