Documentation improvement system_param.rs (#20157)

# Objective
Improvement of the documentation for SystemParam derive section so that
it mentions how to use a Query<&SomeComponent> as a SystemParam for a
struct that should have #[derive(SystemParam)].

## Solution
Added the documentation

---

## Showcase
the previous documentation
```rust
Query<'w, 's, Entity>,
Res<'w, SomeResource>,
ResMut<'w, SomeOtherResource>,
Local<'s, u8>,
Commands<'w, 's>,
EventReader<'w, 's, SomeEvent>,
EventWriter<'w, SomeEvent>
```
the new documentation
```rust
Query<'w, 's, Entity>,
Query<'w, 's, &'static SomeComponent>,  <================== the new thing
Res<'w, SomeResource>,
ResMut<'w, SomeOtherResource>,
Local<'s, u8>,
Commands<'w, 's>,
EventReader<'w, 's, SomeEvent>,
EventWriter<'w, SomeEvent>
```
This commit is contained in:
tomaspecl 2025-07-16 19:58:18 +02:00 committed by GitHub
parent e7c14bd06b
commit 2bcd85421e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,6 +55,8 @@ use variadics_please::{all_tuples, all_tuples_enumerated};
///
/// ```
/// # use bevy_ecs::prelude::*;
/// # #[derive(Component)]
/// # struct SomeComponent;
/// # #[derive(Resource)]
/// # struct SomeResource;
/// # #[derive(BufferedEvent)]
@ -66,6 +68,8 @@ use variadics_please::{all_tuples, all_tuples_enumerated};
/// # struct ParamsExample<'w, 's> {
/// # query:
/// Query<'w, 's, Entity>,
/// # query2:
/// Query<'w, 's, &'static SomeComponent>,
/// # res:
/// Res<'w, SomeResource>,
/// # res_mut: