Skip to content

Commit 96fbf0e

Browse files
committed
Bump cargo-manifest-proc-macros to 0.3.2 to support older rust versions.
1 parent d86198c commit 96fbf0e

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

crates/bevy_macro_utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ keywords = ["bevy"]
1212
syn = "2.0"
1313
quote = "1.0"
1414
proc-macro2 = "1.0"
15-
cargo-manifest-proc-macros = "0.3.1"
15+
cargo-manifest-proc-macros = "0.3.2"
1616

1717
[lints]
1818
workspace = true

tests-integration/simple-ecs-test/src/lib.rs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,35 @@
22
use bevy::prelude::*;
33

44
#[derive(Component)]
5-
struct _Component {
6-
_value: f32,
5+
struct MyComponent {
6+
value: f32,
77
}
88

99
#[derive(Resource)]
10-
struct _Resource {
11-
_value: f32,
10+
struct MyResource {
11+
value: f32,
1212
}
1313

14-
fn hello_world() {
15-
println!("hello world!");
14+
fn hello_world(query: Query<&MyComponent>, resource: Res<MyResource>) {
15+
let component = query.iter().next().unwrap();
16+
let comp_value = component.value; // suggestions work
17+
let res_value_deref = resource.value; // suggestions don't work but ctrl+click works once it's written, also type inlay hints work correctly
18+
let res_value_direct = resource.into_inner().value; // suggestions work
19+
println!(
20+
"hello world! Value: {} {} {}",
21+
comp_value, res_value_deref, res_value_direct
22+
);
23+
}
24+
25+
fn spawn_component(mut commands: Commands) {
26+
commands.spawn(MyComponent { value: 10.0 });
1627
}
1728

1829
#[test]
1930
fn simple_ecs_test() {
20-
App::new().add_systems(Update, hello_world).run();
31+
App::new()
32+
.insert_resource(MyResource { value: 5.0 })
33+
.add_systems(Startup, spawn_component)
34+
.add_systems(Update, hello_world)
35+
.run();
2136
}

0 commit comments

Comments
 (0)