Skip to content

Commit

Permalink
Update toml
Browse files Browse the repository at this point in the history
  • Loading branch information
qhdwight committed Aug 8, 2023
1 parent 9945769 commit 64a2861
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
20 changes: 15 additions & 5 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
# Add the contents of this file to `config.toml` to enable "fast build" configuration. Please read the notes below.

# NOTE: For maximum performance, build using a nightly compiler
# If you are using rust stable, remove the "-Zshare-generics=y" below.

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"]

# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager:
# `brew install michaeleisel/zld/zld`
# NOTE: you must install [Mach-O LLD Port](https://lld.llvm.org/MachO/index.html) on mac. you can easily do this by installing llvm which includes lld with the "brew" package manager:
# `brew install llvm`
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y"]
rustflags = [
"-C",
"link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld",
"-Zshare-generics=y",
]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y"]
rustflags = [
"-C",
"link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
"-Zshare-generics=y",
]

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
rustflags = ["-Zshare-generics=n"]
rustflags = ["-Zshare-generics=y"]

# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
Expand Down
21 changes: 19 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bevy = { version = "0.11.0", features = ["serialize"] }
bevy_rapier3d = { version = "0.22.0", features = ["enhanced-determinism", "debug-render"] }
bytemuck = "1.7"
ron = "0.8.0"
toml = "0.5.9"
toml = "0.7.3"
flagset = "0.4.3"
serde = "1.0.149"
smartstring = { version = "1.0.1", features = ["serde"] }
Expand Down
3 changes: 2 additions & 1 deletion src/qgame/input.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::f32::consts::FRAC_PI_2;
use std::str::from_utf8;

use bevy::{
asset::{AssetLoader, LoadContext, LoadedAsset},
Expand Down Expand Up @@ -155,7 +156,7 @@ impl AssetLoader for ConfigAssetLoader {
load_context: &'a mut LoadContext,
) -> BoxedFuture<'a, Result<(), anyhow::Error>> {
Box::pin(async move {
let asset: Config = toml::from_slice(bytes)?;
let asset: Config = toml::from_str(from_utf8(bytes)?)?;
load_context.set_default_asset(LoadedAsset::new(asset));
Ok(())
})
Expand Down
3 changes: 2 additions & 1 deletion src/qgame/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::{
option::Option,
time::Duration,
};
use std::str::from_utf8;

use bevy::{
asset::{AssetLoader, LoadContext, LoadedAsset},
Expand Down Expand Up @@ -115,7 +116,7 @@ impl AssetLoader for ConfigAssetLoader {
load_context: &'a mut LoadContext,
) -> BoxedFuture<'a, Result<(), anyhow::Error>> {
Box::pin(async move {
let asset: GunProps = toml::from_slice(bytes)?;
let asset: GunProps = toml::from_str(from_utf8(bytes)?)?;
load_context.set_default_asset(LoadedAsset::new(asset));
Ok(())
})
Expand Down

0 comments on commit 64a2861

Please sign in to comment.