mirror of
https://github.com/bevyengine/bevy
synced 2024-11-23 13:13:49 +00:00
Fixed style and typos
This commit is contained in:
parent
504a500bfc
commit
1d47074192
3 changed files with 19 additions and 21 deletions
|
@ -419,10 +419,10 @@ pub fn impl_param_set(_input: TokenStream) -> TokenStream {
|
|||
pub fn impl_data_set(_input: TokenStream) -> TokenStream {
|
||||
let mut tokens = TokenStream::new();
|
||||
let max_members = 8;
|
||||
let datas = get_idents(|i| format!("D{i}"), max_members);
|
||||
let data_types = get_idents(|i| format!("D{i}"), max_members);
|
||||
let accesses = get_idents(|i| format!("access{i}"), max_members);
|
||||
let mut member_fn_muts = Vec::new();
|
||||
for (i, data) in datas.iter().enumerate() {
|
||||
for (i, data) in data_types.iter().enumerate() {
|
||||
let fn_name = Ident::new(&format!("d{i}"), Span::call_site());
|
||||
let index = Index::from(i);
|
||||
let ordinal = match i {
|
||||
|
@ -431,8 +431,7 @@ pub fn impl_data_set(_input: TokenStream) -> TokenStream {
|
|||
3 => "3rd".to_owned(),
|
||||
x => format!("{x}th"),
|
||||
};
|
||||
let comment =
|
||||
format!("Gets exclusive access to the {ordinal} member of this [`DataSet`].");
|
||||
let comment = format!("Gets exclusive access to the {ordinal} member of this [`DataSet`].");
|
||||
member_fn_muts.push(quote! {
|
||||
#[doc = #comment]
|
||||
/// No other members may be accessed while this one is active.
|
||||
|
@ -450,7 +449,7 @@ pub fn impl_data_set(_input: TokenStream) -> TokenStream {
|
|||
}
|
||||
|
||||
for member_count in 1..=max_members {
|
||||
let data = &datas[0..member_count];
|
||||
let data = &data_types[0..member_count];
|
||||
let access = &accesses[0..member_count];
|
||||
let member_fn_mut = &member_fn_muts[0..member_count];
|
||||
tokens.extend(TokenStream::from(quote! {
|
||||
|
|
|
@ -320,7 +320,7 @@ mod tests {
|
|||
component::{Component, Components, Tick},
|
||||
entity::{Entities, Entity},
|
||||
prelude::{AnyOf, EntityRef},
|
||||
query::{Added, Changed, Or, With, Without, DataSet},
|
||||
query::{Added, Changed, DataSet, Or, With, Without},
|
||||
removal_detection::RemovedComponents,
|
||||
schedule::{
|
||||
apply_deferred, common_conditions::resource_exists, Condition, IntoSystemConfigs,
|
||||
|
@ -810,7 +810,6 @@ mod tests {
|
|||
run_system(&mut world, sys);
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn data_set_system() {
|
||||
fn sys(mut _query: Query<DataSet<(&mut A, &A)>>) {}
|
||||
|
|
Loading…
Reference in a new issue