Skip to content

Commit f47b1c0

Browse files
authored
Bump ron version to 0.10. (#19631)
# Objective - Update ron to the latest version. - This is blocking changes to AnimationGraph (as some valid structs are not capable of being deserialized). ## Solution - Bump ron! ## Testing - The particular issue I was blocked by seems to be resolved!
1 parent 2b0a05c commit f47b1c0

File tree

9 files changed

+20
-17
lines changed

9 files changed

+20
-17
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ bevy_dylib = { path = "crates/bevy_dylib", version = "0.16.0-dev", default-featu
562562
[dev-dependencies]
563563
rand = "0.8.0"
564564
rand_chacha = "0.3.1"
565-
ron = "0.8.0"
565+
ron = "0.10"
566566
flate2 = "1.0"
567567
serde = { version = "1", features = ["derive"] }
568568
serde_json = "1.0.140"

crates/bevy_animation/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ bevy_platform = { path = "../bevy_platform", version = "0.16.0-dev", default-fea
3232

3333
# other
3434
petgraph = { version = "0.7", features = ["serde-1"] }
35-
ron = "0.8"
35+
ron = "0.10"
3636
serde = "1"
3737
blake3 = { version = "1.0" }
3838
downcast-rs = { version = "2", default-features = false, features = ["std"] }

crates/bevy_animation/src/graph.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//! The animation graph, which allows animations to be blended together.
22
33
use core::{
4+
fmt::Write,
45
iter,
56
ops::{Index, IndexMut, Range},
67
};
7-
use std::io::{self, Write};
8+
use std::io;
89

910
use bevy_asset::{
1011
io::Reader, Asset, AssetEvent, AssetId, AssetLoader, AssetPath, Assets, Handle, LoadContext,

crates/bevy_asset/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ parking_lot = { version = "0.12", default-features = false, features = [
5454
"arc_lock",
5555
"send_guard",
5656
] }
57-
ron = { version = "0.8", default-features = false }
57+
ron = { version = "0.10", default-features = false }
5858
serde = { version = "1", default-features = false, features = ["derive"] }
5959
thiserror = { version = "2", default-features = false }
6060
derive_more = { version = "1", default-features = false, features = ["from"] }

crates/bevy_dev_tools/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ bevy_state = { path = "../bevy_state", version = "0.16.0-dev" }
3131

3232
# other
3333
serde = { version = "1.0", features = ["derive"], optional = true }
34-
ron = { version = "0.8.0", optional = true }
34+
ron = { version = "0.10", optional = true }
3535
tracing = { version = "0.1", default-features = false, features = ["std"] }
3636

3737
[lints]

crates/bevy_reflect/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ wgpu-types = { version = "24", features = [
114114
], optional = true, default-features = false }
115115

116116
[dev-dependencies]
117-
ron = "0.8.0"
117+
ron = "0.10"
118118
rmp-serde = "1.1"
119119
bincode = { version = "2.0", features = ["serde"] }
120120
serde_json = "1.0.140"

crates/bevy_reflect/src/serde/ser/processor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ use crate::{PartialReflect, TypeRegistry};
112112
/// }
113113
/// }
114114
///
115-
/// fn save(type_registry: &TypeRegistry, asset: &MyAsset) -> Result<Vec<u8>, AssetError> {
116-
/// let mut asset_bytes = Vec::new();
115+
/// fn save(type_registry: &TypeRegistry, asset: &MyAsset) -> Result<String, AssetError> {
116+
/// let mut asset_string = String::new();
117117
///
118118
/// let processor = HandleProcessor;
119119
/// let serializer = ReflectSerializer::with_processor(asset, type_registry, &processor);
120-
/// let mut ron_serializer = ron::Serializer::new(&mut asset_bytes, None)?;
120+
/// let mut ron_serializer = ron::Serializer::new(&mut asset_string, None)?;
121121
///
122122
/// serializer.serialize(&mut ron_serializer)?;
123-
/// Ok(asset_bytes)
123+
/// Ok(asset_string)
124124
/// }
125125
/// ```
126126
///

examples/animation/animation_graph.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,19 @@ fn setup_assets_programmatically(
180180

181181
IoTaskPool::get()
182182
.spawn(async move {
183+
use std::io::Write;
184+
185+
let serialized_graph =
186+
ron::ser::to_string_pretty(&animation_graph, PrettyConfig::default())
187+
.expect("Failed to serialize the animation graph");
183188
let mut animation_graph_writer = File::create(Path::join(
184189
&FileAssetReader::get_base_path(),
185190
Path::join(Path::new("assets"), Path::new(ANIMATION_GRAPH_PATH)),
186191
))
187192
.expect("Failed to open the animation graph asset");
188-
ron::ser::to_writer_pretty(
189-
&mut animation_graph_writer,
190-
&animation_graph,
191-
PrettyConfig::default(),
192-
)
193-
.expect("Failed to serialize the animation graph");
193+
animation_graph_writer
194+
.write_all(serialized_graph.as_bytes())
195+
.expect("Failed to write the animation graph");
194196
})
195197
.detach();
196198
}

tools/example-showcase/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
88
[dependencies]
99
xshell = "0.2"
1010
clap = { version = "4.0", features = ["derive"] }
11-
ron = "0.8"
11+
ron = "0.10"
1212
toml_edit = { version = "0.22.7", default-features = false, features = [
1313
"parse",
1414
] }

0 commit comments

Comments
 (0)