include str

This commit is contained in:
TudbuT 2024-11-24 19:36:31 +01:00
parent 718f5f7c78
commit 72a8a42870
No known key found for this signature in database
GPG key ID: B3CF345217F202D3
3 changed files with 2 additions and 23 deletions

21
Cargo.lock generated
View file

@ -3219,7 +3219,6 @@ dependencies = [
"num-traits", "num-traits",
"ordered-float", "ordered-float",
"parry2d", "parry2d",
"rayon",
"rustc-hash 2.0.0", "rustc-hash 2.0.0",
"simba", "simba",
"thiserror", "thiserror",
@ -3238,26 +3237,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
[[package]]
name = "rayon"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
dependencies = [
"either",
"rayon-core",
]
[[package]]
name = "rayon-core"
version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
dependencies = [
"crossbeam-deque",
"crossbeam-utils",
]
[[package]] [[package]]
name = "readformat" name = "readformat"
version = "0.1.2" version = "0.1.2"

View file

@ -5,7 +5,7 @@ edition = "2021"
[dependencies] [dependencies]
bevy = { version = "0.14.2" } bevy = { version = "0.14.2" }
bevy_rapier2d = {version = "0.27.0", features = ["debug-render-2d", "simd-stable", "parallel"]} bevy_rapier2d = {version = "0.27.0", features = ["debug-render-2d", "simd-stable"]}
# bevy_editor_pls = "0.10" # bevy_editor_pls = "0.10"
readformat = "0.1.2" readformat = "0.1.2"

View file

@ -70,7 +70,7 @@ pub(super) fn import_text_world(
mut materials: ResMut<Assets<ColorMaterial>>, mut materials: ResMut<Assets<ColorMaterial>>,
mut player_spawn_oneshot: Res<PlayerSpawnOneshot>, mut player_spawn_oneshot: Res<PlayerSpawnOneshot>,
) { ) {
let world_string = fs::read_to_string("assets/world.txt").expect("need a world to load"); let world_string = include_str!("../../assets/world.txt");
let [info_string, links_string, world_string] = let [info_string, links_string, world_string] =
&readf("header\n{}\nlinks\n{}\nblocks\n{}", &world_string) &readf("header\n{}\nlinks\n{}\nblocks\n{}", &world_string)
.expect("world does not have sections")[..] .expect("world does not have sections")[..]