Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance/18/ongoing code maintenance #19

Merged
merged 3 commits into from
Feb 12, 2020
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
11 changes: 4 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ description = "Scene graph type hierarchy abstraction for use with specs"
keywords = ["specs", "scenegraph", "hierarchy"]

[dependencies]
hibitset = { version = "0.6", default-features = false }
specs = { version = "0.15", default-features = false }
shred = { version = "0.9", default-features = false }
shrev = "1.1"
shred-derive = "0.6"
hibitset = { version = "0.6.2", default-features = false }
specs = { version = "0.16.0", default-features = false, features = ["shred-derive"] }
shrev = "1.1.1"

[features]
default = ["parallel"]
parallel = ["specs/parallel", "shred/parallel", "hibitset/parallel"]
nightly = ["specs/nightly", "shred/nightly"]
parallel = ["specs/parallel", "hibitset/parallel"]
7 changes: 2 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
/// ```
///
extern crate hibitset;
extern crate shred;
#[macro_use]
extern crate shred_derive;
extern crate shrev;
extern crate specs;

Expand Down Expand Up @@ -168,7 +165,7 @@ impl<P> Hierarchy<P> {
///
/// This does not include the parent entity you pass in. Parents are guaranteed to be
/// prior to their children.
pub fn all_children_iter<'a>(&'a self, entity: Entity) -> SubHierarchyIterator<'a, P> {
pub fn all_children_iter(&self, entity: Entity) -> SubHierarchyIterator<'_, P> {
SubHierarchyIterator::new(self, entity)
}

Expand Down Expand Up @@ -292,7 +289,7 @@ impl<P> Hierarchy<P> {
.min()
.cloned()
})
.unwrap_or(self.sorted.len());
.unwrap_or_else(|| self.sorted.len());
self.entities.insert(entity.id(), insert_index);
if insert_index >= self.sorted.len() {
self.sorted.push(entity);
Expand Down