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

update all depdnencies including hashbrown #748

Merged
merged 1 commit into from
Jul 1, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 8 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,23 @@ travis-ci = { repository = "slide-rs/specs" }

[dependencies]
crossbeam-queue = "0.3"
hashbrown = "0.11"
hashbrown = "0.12"
hibitset = { version = "0.6.3", default-features = false }
log = "0.4.8"
shred = { version = "0.12", default-features = false }
shred = { version = "0.13", default-features = false }
shrev = "1.1.1"
tuple_utils = "0.3.0"
tuple_utils = "0.4.0"

rayon = { version = "1.5.1", optional = true }
serde = { version = "1.0.104", optional = true, features = ["serde_derive"] }
specs-derive = { version = "0.4.1", path = "specs-derive", optional = true }
uuid = { version = "0.8.1", optional = true, features = ["v4", "serde"] }
uuid = { version = "1.0", optional = true, features = ["v4", "serde"] }

[features]
default = ["parallel"]
parallel = ["rayon", "shred/parallel", "hibitset/parallel"]
uuid_entity = ["uuid", "serde"]
stdweb = ["uuid/stdweb"]
wasm-bindgen = ["uuid/wasm-bindgen"]
stdweb = ["uuid/js"]
storage-event-control = []
derive = ["shred-derive", "specs-derive"]
nightly = []
Expand All @@ -51,12 +50,12 @@ shred-derive = ["shred/shred-derive"]
features = ["parallel", "serde", "shred-derive", "specs-derive", "uuid_entity", "storage-event-control"]

[dev-dependencies]
nalgebra = "0.24"
nalgebra = "0.31"
criterion = "0.3.1"
ron = "0.5.1"
ron = "0.7.1"
rand = "0.8"
serde_json = "1.0.48"
shred = { version = "0.12.0", default-features = false, features = ["shred-derive"] }
shred = { version = "0.13.0", default-features = false, features = ["shred-derive"] }
specs-derive = { path = "specs-derive", version = "0.4.1" }

[[example]]
Expand Down
16 changes: 10 additions & 6 deletions examples/saveload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extern crate serde;
extern crate specs;

use std::{convert::Infallible, fmt};
use ron::ser::PrettyConfig;

use specs::{
prelude::*,
Expand Down Expand Up @@ -67,11 +68,11 @@ impl Component for Mass {
// type that implements the `Display`-trait. In this case we want to be able to
// return different errors, and we are going to use a `.ron`-file to store our
// data. Therefore we use a custom enum, which can display both the
// `Infallible`and `ron::ser::Error` type. This enum could be extended to
// `Infallible`and `ron::error::Error` type. This enum could be extended to
// incorporate for example `std::io::Error` and more.
#[derive(Debug)]
enum Combined {
Ron(ron::ser::Error),
Ron(ron::error::Error),
}

// Implementing the required `Display`-trait, by matching the `Combined` enum,
Expand All @@ -86,8 +87,8 @@ impl fmt::Display for Combined {

// This returns the `ron::ser:Error` in form of the `Combined` enum, which can
// then be matched and displayed accordingly.
impl From<ron::ser::Error> for Combined {
fn from(x: ron::ser::Error) -> Self {
impl From<ron::error::Error> for Combined {
fn from(x: ron::error::Error) -> Self {
Combined::Ron(x)
}
}
Expand Down Expand Up @@ -153,7 +154,10 @@ fn main() {
fn run(&mut self, (ents, pos, mass, markers): Self::SystemData) {
// First we need a serializer for the format of choice, in this case the
// `.ron`-format.
let mut ser = ron::ser::Serializer::new(Some(Default::default()), true);
let mut buf = Vec::new();
let mut config = PrettyConfig::default();
config.struct_names = true;
let mut ser = ron::ser::Serializer::with_options(&mut buf, Some(config), Default::default()).unwrap();

// For serialization we use the
// [`SerializeComponents`](struct.SerializeComponents.html)-trait's `serialize`
Expand Down Expand Up @@ -183,7 +187,7 @@ fn main() {

// At this point, `ser` could be used to write its contents to a file, which is
// not done here. Instead we print the content of this pseudo-file.
println!("{}", ser.into_output_string());
println!("{}", String::from_utf8(buf).expect("Ron should be utf-8"));
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/saveload/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ mod marker_test {
.build();

// Serialize all entities
let mut ser = ron::ser::Serializer::new(Some(Default::default()), true);
let mut buf = Vec::new();
let mut config = ron::ser::PrettyConfig::default();
config.struct_names = true;
let mut ser = ron::ser::Serializer::with_options(&mut buf, Some(config), Default::default()).unwrap();

world.exec(
|(ents, comp_a, comp_b, markers, _alloc): (
Expand All @@ -82,7 +85,7 @@ mod marker_test {
},
);

let serial = ser.into_output_string();
let serial = String::from_utf8(buf).expect("Ron should be utf-8");

let mut de = ron::de::Deserializer::from_str(&serial).unwrap();

Expand Down