Skip to content

Commit

Permalink
remove Default impl for Entities
Browse files Browse the repository at this point in the history
add Entities::new
  • Loading branch information
leudz committed May 5, 2020
1 parent e1dabe6 commit 98085c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/storage/all/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl AllStorages {
pub(crate) fn new() -> Self {
let mut storages = HashMap::default();

let entities = Entities::default();
let entities = Entities::new();

#[cfg(feature = "std")]
{
Expand Down
9 changes: 3 additions & 6 deletions src/storage/entity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@ pub struct Entities {
list: Option<(usize, usize)>,
}

impl Default for Entities {
fn default() -> Self {
impl Entities {
pub(crate) fn new() -> Self {
Entities {
data: Vec::new(),
list: None,
}
}
}

impl Entities {
pub(super) fn delete(&mut self, entity: EntityId) -> bool {
self.delete_unchecked(entity)
}
Expand Down Expand Up @@ -221,7 +218,7 @@ impl UnknownStorage for Entities {
fn entities() {
use core::num::NonZeroU64;

let mut entities = Entities::default();
let mut entities = Entities::new();

let key00 = entities.generate();
let key10 = entities.generate();
Expand Down

0 comments on commit 98085c0

Please sign in to comment.