Fix minor typos in code and docs (#7378)

# Objective

I found several words in code and docs are incorrect. This should be fixed.

## Solution

- Fix several minor typos

Co-authored-by: Chris Ohk <utilforever@gmail.com>
This commit is contained in:
Chris Ohk 2023-01-27 12:12:53 +00:00
parent 70e51179bf
commit 3281aea5c2
31 changed files with 45 additions and 45 deletions

View file

@ -103,7 +103,7 @@ Some things that are reason to apply the [`S-Controversial`] label to a PR:
Some things that are reason to apply the [`D-Complex`] label to a PR:
1. Introduction or modification of soundness relevent code (for example `unsafe` code)
1. Introduction or modification of soundness relevant code (for example `unsafe` code)
2. High levels of technical complexity.
3. Large-scale code reorganization
@ -324,7 +324,7 @@ If you're new to Bevy, here's the workflow we use:
* `cargo run -p ci -- test` - to run tests
* `cargo run -p ci -- doc` - to run doc tests and doc checks
* `cargo run -p ci -- compile` - to check that everything that must compile still does (examples and benches), and that some that shouldn't still don't ([`crates/bevy_ecs_compile_fail_tests`](./crates/bevy_ecs_compile_fail_tests))
* to get more informations on commands available and what is run, check the [tools/ci crate](./tools/ci)
* to get more information on commands available and what is run, check the [tools/ci crate](./tools/ci)
4. When working with Markdown (`.md`) files, Bevy's CI will check markdown files (like this one) using [markdownlint](https://github.com/DavidAnson/markdownlint).
To locally lint your files using the same workflow as our CI:

View file

@ -468,7 +468,7 @@ fn apply_animation(
// any of their descendant Transforms.
//
// The system scheduler prevents any other system from mutating Transforms at the same time,
// so the only way this fetch can alias is if two AnimationPlayers are targetting the same bone.
// so the only way this fetch can alias is if two AnimationPlayers are targeting the same bone.
// This can only happen if there are two or more AnimationPlayers are ancestors to the same
// entities. By verifying that there is no other AnimationPlayer in the ancestors of a
// running AnimationPlayer before animating any entity, this fetch cannot alias.

View file

@ -64,7 +64,7 @@ impl ArchetypeRow {
/// Archetype IDs are only valid for a given World, and are not globally unique.
/// Attempting to use an archetype ID on a world that it wasn't sourced from will
/// not return the archetype with the same components. The only exception to this is
/// [`EMPTY`] which is guarenteed to be identical for all Worlds.
/// [`EMPTY`] which is guaranteed to be identical for all Worlds.
///
/// [`World`]: crate::world::World
/// [`EMPTY`]: crate::archetype::ArchetypeId::EMPTY

View file

@ -1536,7 +1536,7 @@ mod tests {
assert_eq!(4, query_min_size![&A, ()], "Simple Archetypal");
assert_eq!(4, query_min_size![ChangeTrackers<A>, ()],);
// All the following should set minimum size to 0, as it's impossible to predict
// how many entites the filters will trim.
// how many entities the filters will trim.
assert_eq!(0, query_min_size![(), Added<A>], "Simple Added");
assert_eq!(0, query_min_size![(), Changed<A>], "Simple Changed");
assert_eq!(0, query_min_size![(&A, &B), Changed<A>],);
@ -1616,7 +1616,7 @@ mod tests {
assert_eq!(
world_b.get::<B>(high_non_existent_entity),
Some(&B(10)),
"inserting into newly allocated high / non-continous entity id works"
"inserting into newly allocated high / non-continuous entity id works"
);
let high_non_existent_but_reserved_entity = Entity::new(5, 0);

View file

@ -1537,7 +1537,7 @@ mod tests {
#[derive(Component)]
struct Foo;
fn even_number_of_entities_critiera(query: Query<&Foo>) -> ShouldRun {
fn even_number_of_entities_criteria(query: Query<&Foo>) -> ShouldRun {
if query.iter().len() % 2 == 0 {
ShouldRun::Yes
} else {
@ -1562,7 +1562,7 @@ mod tests {
.with_system(spawn_entity.label(Spawn))
.with_system_set(
SystemSet::new()
.with_run_criteria(even_number_of_entities_critiera)
.with_run_criteria(even_number_of_entities_criteria)
.with_system(count_entities.before(Spawn)),
);
stage.run(&mut world);
@ -1579,7 +1579,7 @@ mod tests {
#[derive(Component)]
struct Foo;
fn even_number_of_entities_critiera(query: Query<&Foo>) -> ShouldRun {
fn even_number_of_entities_criteria(query: Query<&Foo>) -> ShouldRun {
if query.iter().len() % 2 == 0 {
ShouldRun::Yes
} else {
@ -1599,7 +1599,7 @@ mod tests {
world.init_resource::<EntityCount>();
let mut stage_spawn = SystemStage::parallel().with_system(spawn_entity);
let mut stage_count = SystemStage::parallel()
.with_run_criteria(even_number_of_entities_critiera)
.with_run_criteria(even_number_of_entities_criteria)
.with_system(count_entities);
stage_count.run(&mut world);
stage_spawn.run(&mut world);

View file

@ -519,8 +519,8 @@ impl ScheduleGraph {
match ambiguous_with {
Ambiguity::Check => (),
Ambiguity::IgnoreWithSet(ambigous_with) => {
for set in ambigous_with
Ambiguity::IgnoreWithSet(ambiguous_with) => {
for set in ambiguous_with
.into_iter()
.map(|set| self.system_set_ids[&set])
{

View file

@ -102,7 +102,7 @@ impl CommandQueue {
// so this addition will not overflow its original allocation.
let cmd = unsafe { self.bytes.as_mut_ptr().add(meta.offset) };
// SAFETY: It is safe to transfer ownership out of `self.bytes`, since the call to `set_len(0)` above
// gaurantees that nothing stored in the buffer will get observed after this function ends.
// guarantees that nothing stored in the buffer will get observed after this function ends.
// `cmd` points to a valid address of a stored command, so it must be non-null.
let cmd = unsafe { OwningPtr::new(NonNull::new_unchecked(cmd.cast())) };
// SAFETY: The underlying type of `cmd` matches the type expected by `meta.apply_command`.

View file

@ -281,7 +281,7 @@ pub enum KeyCode {
Apostrophe,
/// The `Apps` key.
Apps,
/// The `Asterik` / `*` key.
/// The `Asterisk` / `*` key.
Asterisk,
/// The `Plus` / `+` key.
Plus,

View file

@ -88,7 +88,7 @@ impl Default for PointLightShadowMap {
}
/// A light that emits light in a given direction from a central point.
/// Behaves like a point light in a perfectly absorbant housing that
/// Behaves like a point light in a perfectly absorbent housing that
/// shines light only in a given direction. The direction is taken from
/// the transform, and can be specified with [`Transform::looking_at`](bevy_transform::components::Transform::looking_at).
#[derive(Component, Debug, Clone, Copy, Reflect)]

View file

@ -190,7 +190,7 @@ pub struct StandardMaterial {
/// When a triangle is in a viewport,
/// if its vertices appear counter-clockwise from the viewport's perspective,
/// then the viewport is seeing the triangle's front face.
/// Conversly, if the vertices appear clockwise, you are seeing the back face.
/// Conversely, if the vertices appear clockwise, you are seeing the back face.
///
/// In short, in bevy, front faces winds counter-clockwise.
///

View file

@ -75,7 +75,7 @@ fn fetch_spot_shadow(light_id: u32, frag_position: vec4<f32>, surface_normal: ve
let light_inv_rot = mat3x3<f32>(right_dir, up_dir, fwd);
// because the matrix is a pure rotation matrix, the inverse is just the transpose, and to calculate
// the product of the transpose with a vector we can just post-multiply instead of pre-multplying.
// the product of the transpose with a vector we can just post-multiply instead of pre-multiplying.
// this allows us to keep the matrix construction code identical between CPU and GPU.
let projected_position = offset_position * light_inv_rot;

View file

@ -461,13 +461,13 @@ impl<T: Sized> DebugEnsureAligned for *mut T {
#[track_caller]
fn debug_ensure_aligned(self) -> Self {
let align = core::mem::align_of::<T>();
// Implemenation shamelessly borrowed from the currently unstable
// Implementation shamelessly borrowed from the currently unstable
// ptr.is_aligned_to.
//
// Replace once https://github.com/rust-lang/rust/issues/96284 is stable.
assert!(
self as usize & (align - 1) == 0,
"pointer is not aligned. Address {:p} does not have alignemnt {} for type {}",
"pointer is not aligned. Address {:p} does not have alignment {} for type {}",
self,
align,
core::any::type_name::<T>(),

View file

@ -349,7 +349,7 @@ impl<'a> ReflectStruct<'a> {
/// Returns the `GetTypeRegistration` impl as a `TokenStream`.
///
/// Returns a specific implementation for structs and this method should be preffered over the generic [`get_type_registration`](crate::ReflectMeta) method
/// Returns a specific implementation for structs and this method should be preferred over the generic [`get_type_registration`](crate::ReflectMeta) method
pub fn get_type_registration(&self) -> proc_macro2::TokenStream {
let reflect_path = self.meta.bevy_reflect_path();

View file

@ -37,8 +37,8 @@ pub(crate) fn get_variant_constructors(
}
};
let mut reflect_index: usize = 0;
let constructor_fields = fields.iter().enumerate().map(|(declar_index, field)| {
let field_ident = ident_or_index(field.data.ident.as_ref(), declar_index);
let constructor_fields = fields.iter().enumerate().map(|(declare_index, field)| {
let field_ident = ident_or_index(field.data.ident.as_ref(), declare_index);
let field_value = if field.attrs.ignore.is_ignored() {
quote! { #FQDefault::default() }
} else {

View file

@ -379,9 +379,9 @@ fn generate_impls(reflect_enum: &ReflectEnum, ref_index: &Ident, ref_name: &Iden
}
EnumVariantFields::Unnamed(fields) => {
let args = get_field_args(fields, |reflect_idx, declaration_index, field| {
let declar_field = syn::Index::from(declaration_index);
let declare_field = syn::Index::from(declaration_index);
enum_field_at.push(quote! {
#unit { #declar_field : value, .. } if #ref_index == #reflect_idx => #FQOption::Some(value)
#unit { #declare_field : value, .. } if #ref_index == #reflect_idx => #FQOption::Some(value)
});
#[cfg(feature = "documentation")]

View file

@ -30,7 +30,7 @@ enum BindingState<'a> {
ident: &'a Ident,
},
OccupiedConvertedUniform,
OccupiedMergableUniform {
OccupiedMergeableUniform {
uniform_fields: Vec<&'a syn::Field>,
},
}
@ -144,7 +144,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> {
match &mut binding_states[binding_index as usize] {
value @ BindingState::Free => {
*value = match binding_type {
BindingType::Uniform => BindingState::OccupiedMergableUniform {
BindingType::Uniform => BindingState::OccupiedMergeableUniform {
uniform_fields: vec![field],
},
_ => {
@ -179,7 +179,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> {
format!("The '{field_name}' field cannot be assigned to binding {binding_index} because it is already occupied by a struct-level uniform binding at the same index.")
));
}
BindingState::OccupiedMergableUniform { uniform_fields } => match binding_type {
BindingState::OccupiedMergeableUniform { uniform_fields } => match binding_type {
BindingType::Uniform => {
uniform_fields.push(field);
}
@ -306,7 +306,7 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> {
let mut field_struct_impls = Vec::new();
for (binding_index, binding_state) in binding_states.iter().enumerate() {
let binding_index = binding_index as u32;
if let BindingState::OccupiedMergableUniform { uniform_fields } = binding_state {
if let BindingState::OccupiedMergeableUniform { uniform_fields } = binding_state {
let binding_vec_index = bind_group_entries.len();
bind_group_entries.push(quote! {
#render_path::render_resource::BindGroupEntry {

View file

@ -806,7 +806,7 @@ fn log_shader_error(source: &ProcessedShader, error: &AsModuleDescriptorError) {
#[derive(Error, Debug)]
pub enum PipelineCacheError {
#[error(
"Pipeline cound not be compiled because the following shader is not loaded yet: {0:?}"
"Pipeline could not be compiled because the following shader is not loaded yet: {0:?}"
)]
ShaderNotLoaded(Handle<Shader>),
#[error(transparent)]

View file

@ -710,7 +710,7 @@ mod tests {
scope.spawn_on_scope(async move {
inner_count_clone.fetch_add(1, Ordering::Release);
if std::thread::current().id() != spawner {
// NOTE: This check is using an atomic rather than simply panicing the
// NOTE: This check is using an atomic rather than simply panicking the
// thread to avoid deadlocking the barrier on failure
inner_thread_check_failed.store(true, Ordering::Release);
}
@ -785,7 +785,7 @@ mod tests {
scope.spawn_on_scope(async move {
inner_count_clone.fetch_add(1, Ordering::Release);
if std::thread::current().id() != spawner {
// NOTE: This check is using an atomic rather than simply panicing the
// NOTE: This check is using an atomic rather than simply panicking the
// thread to avoid deadlocking the barrier on failure
inner_thread_check_failed.store(true, Ordering::Release);
}

View file

@ -253,7 +253,7 @@ impl<K: Hash + Eq + PartialEq + Clone, V> PreHashMapExt<K, V> for PreHashMap<K,
/// // This will print a message when the variable `_catch` gets dropped,
/// // even if a panic occurs before we reach the end of this scope.
/// // This is similar to a `try ... catch` block in languages such as C++.
/// let _catch = OnDrop::new(|| log("Oops, a panic occured and this function didn't complete!"));
/// let _catch = OnDrop::new(|| log("Oops, a panic occurred and this function didn't complete!"));
///
/// // Some code that may panic...
/// // ...

View file

@ -62,7 +62,7 @@ mod name_formatting_tests {
}
#[test]
fn path_seperated() {
fn path_separated() {
assert_eq!(
get_short_name("bevy_prelude::make_fun_game"),
"make_fun_game".to_string()

View file

@ -554,7 +554,7 @@ impl WindowResolution {
self.physical_height = height;
}
/// Set the window's scale factor, this may get overriden by the backend.
/// Set the window's scale factor, this may get overridden by the backend.
#[inline]
pub fn set_scale_factor(&mut self, scale_factor: f64) {
let (width, height) = (self.width(), self.height());

View file

@ -34,7 +34,7 @@ You can specify the dependency [both as a version and with git](https://doc.rust
You can use one of these badges to communicate to your users how closely you intend to track Bevy's main branch.
<!-- MD033 - The Badges could be downsized, without the inline HTML due to the large code colum -->
<!-- MD033 - The Badges could be downsized, without the inline HTML due to the large code column -->
<!-- markdownlint-disable-next-line MD033 -->
|<div style="width:100px">badge</div>|<div style="width:200px">description</div>|code|
|-|-|-|

View file

@ -34,7 +34,7 @@ You have two solutions:
Solution #1: use disjoint queries using [`Without`](https://docs.rs/bevy/*/bevy/ecs/query/struct.Without.html)
As a `Player` entity won't be an `Enemy` at the same time, those two queries will acutally never target the same entity. This can be encoded in the query filter with [`Without`](https://docs.rs/bevy/*/bevy/ecs/query/struct.Without.html):
As a `Player` entity won't be an `Enemy` at the same time, those two queries will actually never target the same entity. This can be encoded in the query filter with [`Without`](https://docs.rs/bevy/*/bevy/ecs/query/struct.Without.html):
```rust,no_run
use bevy::prelude::*;

View file

@ -51,7 +51,7 @@ thread 'main' panicked at 'error[B0003]: Could not add a component (of type `use
But you don't know which system tried to add a component, and which system despawned the entity.
To get the system that created the command that panics, you can enable the `trace` feature of Bevy. This will add a panic handler that will print more informations:
To get the system that created the command that panics, you can enable the `trace` feature of Bevy. This will add a panic handler that will print more information:
```text
0: bevy_ecs::schedule::stage::system_commands
@ -78,7 +78,7 @@ thread 'main' panicked at 'error[B0003]: Could not add a component (of type `use
From the first line, you know the entity `0v0` was despawned when executing a command from system `despawning`. In a real case, you could have many log lines, you will need to search for the exact entity from the panic message.
Combining those two, you should get enough informations to understand why this panic is happening and how to fix it:
Combining those two, you should get enough information to understand why this panic is happening and how to fix it:
```text
DEBUG stage{name=Update}:system_commands{name="use_entity_after_despawn::despawning"}: bevy_ecs::world: Despawning entity 0v0

View file

@ -386,7 +386,7 @@ You can view the logs with the following command:
adb logcat | grep 'RustStdoutStderr\|bevy\|wgpu'
```
In case of an error getting a GPU or setting it up, you can try settings logs of `wgpu_hal` to `DEBUG` to get more informations.
In case of an error getting a GPU or setting it up, you can try settings logs of `wgpu_hal` to `DEBUG` to get more information.
Sometimes, running the app complains about an unknown activity. This may be fixed by uninstalling the application:

View file

@ -121,7 +121,7 @@ You can view the logs with the following command:
adb logcat | grep 'RustStdoutStderr\|bevy\|wgpu'
```
In case of an error getting a GPU or setting it up, you can try settings logs of `wgpu_hal` to `DEBUG` to get more informations.
In case of an error getting a GPU or setting it up, you can try settings logs of `wgpu_hal` to `DEBUG` to get more information.
Sometimes, running the app complains about an unknown activity. This may be fixed by uninstalling the application:

View file

@ -26,7 +26,7 @@ fn change_component(time: Res<Time>, mut query: Query<(Entity, &mut MyComponent)
if rand::thread_rng().gen_bool(0.1) {
info!("changing component {:?}", entity);
let new_component = MyComponent(time.elapsed_seconds().round());
// Change detection occurs on mutable derefence,
// Change detection occurs on mutable dereference,
// and does not consider whether or not a value is actually equal.
// To avoid triggering change detection when nothing has actually changed,
// you can use the `set_if_neq` method on any component or resource that implements PartialEq

View file

@ -52,7 +52,7 @@ fn remove_component(
}
fn react_on_removal(removed: RemovedComponents<MyComponent>, mut query: Query<&mut Sprite>) {
// `RemovedComponents<T>::iter()` returns an interator with the `Entity`s that had their
// `RemovedComponents<T>::iter()` returns an iterator with the `Entity`s that had their
// `Component` `T` (in this case `MyComponent`) removed at some point earlier during the frame.
for entity in removed.iter() {
if let Ok(mut sprite) = query.get_mut(entity) {

View file

@ -109,7 +109,7 @@ fn is_done(done: Res<Done>) -> ShouldRun {
done.0.into()
}
/// Used with [`RunCritera::pipe`], inverts the result of the
/// Used with [`RunCriteria::pipe`], inverts the result of the
/// passed system.
fn inverse(input: In<ShouldRun>) -> ShouldRun {
match input.0 {

View file

@ -350,7 +350,7 @@ mod menu {
const HOVERED_PRESSED_BUTTON: Color = Color::rgb(0.25, 0.65, 0.25);
const PRESSED_BUTTON: Color = Color::rgb(0.35, 0.75, 0.35);
// Tag component used to mark wich setting is currently selected
// Tag component used to mark which setting is currently selected
#[derive(Component)]
struct SelectedOption;

View file

@ -1,7 +1,7 @@
//! A glTF scene viewer plugin. Provides controls for animation, directional lighting, and switching between scene cameras.
//! To use in your own application:
//! - Copy the code for the `SceneViewerPlugin` and add the plugin to your App.
//! - Insert an initalized `SceneHandle` resource into your App's `AssetServer`.
//! - Insert an initialized `SceneHandle` resource into your App's `AssetServer`.
use bevy::{asset::LoadState, gltf::Gltf, prelude::*, scene::InstanceId};