From b39f83640fce7ae385cc4f02c439e28f562ecdc8 Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Mon, 20 Feb 2023 22:56:57 +0000 Subject: [PATCH] Fix some typos (#7763) # Objective Stumbled on a typo and went on a typo hunt. ## Solution Fix em --- crates/bevy_asset/src/reflect.rs | 4 ++-- crates/bevy_core/src/lib.rs | 2 +- crates/bevy_ecs/src/lib.rs | 6 +++--- crates/bevy_ecs/src/query/mod.rs | 2 +- crates/bevy_ecs/src/query/state.rs | 2 +- crates/bevy_ecs/src/schedule/schedule.rs | 6 +++--- crates/bevy_ecs/src/schedule/state.rs | 4 ++-- crates/bevy_ecs/src/world/mod.rs | 2 +- crates/bevy_ecs/src/world/unsafe_world_cell.rs | 4 ++-- crates/bevy_pbr/src/environment_map/mod.rs | 2 +- crates/bevy_pbr/src/light.rs | 4 ++-- crates/bevy_render/src/lib.rs | 2 +- crates/bevy_render/src/mesh/shape/mod.rs | 2 +- crates/bevy_render/src/texture/fallback_image.rs | 2 +- crates/bevy_render/src/texture/image_texture_conversion.rs | 2 +- crates/bevy_tasks/src/task_pool.rs | 2 +- crates/bevy_time/src/fixed_timestep.rs | 2 +- crates/bevy_utils/src/synccell.rs | 2 +- 18 files changed, 26 insertions(+), 26 deletions(-) diff --git a/crates/bevy_asset/src/reflect.rs b/crates/bevy_asset/src/reflect.rs index 27a0d8ce24..2dc5de3dcb 100644 --- a/crates/bevy_asset/src/reflect.rs +++ b/crates/bevy_asset/src/reflect.rs @@ -19,7 +19,7 @@ pub struct ReflectAsset { get: fn(&World, HandleUntyped) -> Option<&dyn Reflect>, // SAFETY: - // - may only be called with a [`IteriorMutableWorld`] which can be used to access the corresponding `Assets` resource mutably + // - may only be called with an [`UnsafeWorldCell`] which can be used to access the corresponding `Assets` resource mutably // - may only be used to access **at most one** access at once get_unchecked_mut: unsafe fn(UnsafeWorldCell<'_>, HandleUntyped) -> Option<&mut dyn Reflect>, add: fn(&mut World, &dyn Reflect) -> HandleUntyped, @@ -144,7 +144,7 @@ impl FromType for ReflectAsset { asset.map(|asset| asset as &dyn Reflect) }, get_unchecked_mut: |world, handle| { - // SAFETY: `get_unchecked_mut` must be callied with `UnsafeWorldCell` having access to `Assets`, + // SAFETY: `get_unchecked_mut` must be called with `UnsafeWorldCell` having access to `Assets`, // and must ensure to only have at most one reference to it live at all times. let assets = unsafe { world.get_resource_mut::>().unwrap().into_inner() }; let asset = assets.get_mut(&handle.typed()); diff --git a/crates/bevy_core/src/lib.rs b/crates/bevy_core/src/lib.rs index 1a7d13d637..7e58685c9f 100644 --- a/crates/bevy_core/src/lib.rs +++ b/crates/bevy_core/src/lib.rs @@ -33,7 +33,7 @@ use std::path::PathBuf; #[cfg(not(target_arch = "wasm32"))] use bevy_tasks::tick_global_task_pools_on_main_thread; -/// Registration of default types to the `TypeRegistry` reesource. +/// Registration of default types to the `TypeRegistry` resource. #[derive(Default)] pub struct TypeRegistrationPlugin; diff --git a/crates/bevy_ecs/src/lib.rs b/crates/bevy_ecs/src/lib.rs index c41af2f36f..9f00ffd804 100644 --- a/crates/bevy_ecs/src/lib.rs +++ b/crates/bevy_ecs/src/lib.rs @@ -779,17 +779,17 @@ mod tests { assert_eq!( world.removed::().collect::>(), &[], - "clearning trackers clears removals" + "clearing trackers clears removals" ); assert_eq!( world.removed::().collect::>(), &[], - "clearning trackers clears removals" + "clearing trackers clears removals" ); assert_eq!( world.removed::().collect::>(), &[], - "clearning trackers clears removals" + "clearing trackers clears removals" ); // TODO: uncomment when world.clear() is implemented diff --git a/crates/bevy_ecs/src/query/mod.rs b/crates/bevy_ecs/src/query/mod.rs index 1b3e1f4d08..83fe596766 100644 --- a/crates/bevy_ecs/src/query/mod.rs +++ b/crates/bevy_ecs/src/query/mod.rs @@ -14,7 +14,7 @@ pub use state::*; /// A debug checked version of [`Option::unwrap_unchecked`]. Will panic in /// debug modes if unwrapping a `None` or `Err` value in debug mode, but is -/// equivalent to `Option::unwrap_uncheched` or `Result::unwrap_unchecked` +/// equivalent to `Option::unwrap_unchecked` or `Result::unwrap_unchecked` /// in release mode. pub(crate) trait DebugCheckedUnwrap { type Item; diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs index b7b163a2f5..8c8fd43edf 100644 --- a/crates/bevy_ecs/src/query/state.rs +++ b/crates/bevy_ecs/src/query/state.rs @@ -1223,7 +1223,7 @@ mod tests { // It's best to test get_many_unchecked_manual directly, // as it is shared and unsafe - // We don't care about aliased mutabilty for the read-only equivalent + // We don't care about aliased mutability for the read-only equivalent // SAFETY: mutable access is not checked, but we own the world and don't use the query results assert!(unsafe { diff --git a/crates/bevy_ecs/src/schedule/schedule.rs b/crates/bevy_ecs/src/schedule/schedule.rs index 5a9dfbf1aa..78ba800ec3 100644 --- a/crates/bevy_ecs/src/schedule/schedule.rs +++ b/crates/bevy_ecs/src/schedule/schedule.rs @@ -281,7 +281,7 @@ impl Schedule { } } -/// A directed acylic graph structure. +/// A directed acyclic graph structure. #[derive(Default)] pub struct Dag { /// A directed graph. @@ -1379,7 +1379,7 @@ impl ScheduleGraph { /// Get topology sorted [`NodeId`], also ensures the graph contains no cycle /// returns Err(()) if there are cycles fn topsort_graph(&self, graph: &DiGraphMap) -> Result, ()> { - // tarjon_scc's run order is reverse topological order + // tarjan_scc's run order is reverse topological order let mut rev_top_sorted_nodes = Vec::::with_capacity(graph.node_count()); let mut tarjan_scc = bevy_utils::petgraph::algo::TarjanScc::new(); let mut sccs_with_cycle = Vec::>::new(); @@ -1547,7 +1547,7 @@ pub enum ScheduleBuildError { /// Specifies how schedule construction should respond to detecting a certain kind of issue. #[derive(Debug, Clone, PartialEq)] pub enum LogLevel { - /// Occurences are completely ignored. + /// Occurrences are completely ignored. Ignore, /// Occurrences are logged only. Warn, diff --git a/crates/bevy_ecs/src/schedule/state.rs b/crates/bevy_ecs/src/schedule/state.rs index e2b51cf70e..0982441ac1 100644 --- a/crates/bevy_ecs/src/schedule/state.rs +++ b/crates/bevy_ecs/src/schedule/state.rs @@ -17,7 +17,7 @@ pub use bevy_ecs_macros::States; /// You can access the current state of type `T` with the [`State`] resource, /// and the queued state with the [`NextState`] resource. /// -/// State transitions typically occur in the [`OnEnter`] and [`OnExit`] schedules, +/// State transitions typically occur in the [`OnEnter`] and [`OnExit`] schedules, /// which can be run via the [`apply_state_transition::`] system. /// Systems that run each frame in various states are typically stored in the main schedule, /// and are conventionally part of the [`OnUpdate(T::Variant)`] system set. @@ -75,7 +75,7 @@ pub struct State(pub S); /// The next state of [`State`]. /// /// To queue a transition, just set the contained value to `Some(next_state)`. -/// Note that these transitions can be overriden by other systems: +/// Note that these transitions can be overridden by other systems: /// only the actual value of this resource at the time of [`apply_state_transition`] matters. #[derive(Resource, Default, Debug)] pub struct NextState(pub Option); diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index b4109e8f2d..e52fa59c8c 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -1742,7 +1742,7 @@ impl World { .remove_entry(label) .unwrap_or_else(|| panic!("The schedule with the label {label:?} was not found.")); - // TODO: move this span to Schdule::run + // TODO: move this span to Schedule::run #[cfg(feature = "trace")] let _span = bevy_utils::tracing::info_span!("schedule", name = ?extracted_label).entered(); schedule.run(self); diff --git a/crates/bevy_ecs/src/world/unsafe_world_cell.rs b/crates/bevy_ecs/src/world/unsafe_world_cell.rs index 069a9f67ec..364cef1bc3 100644 --- a/crates/bevy_ecs/src/world/unsafe_world_cell.rs +++ b/crates/bevy_ecs/src/world/unsafe_world_cell.rs @@ -299,7 +299,7 @@ impl<'w> UnsafeWorldCell<'w> { // caller ensures that no mutable reference exists to `R` unsafe { self.get_non_send_resource_by_id(component_id) - // SAEFTY: `component_id` was obtained from `TypeId::of::()` + // SAFETY: `component_id` was obtained from `TypeId::of::()` .map(|ptr| ptr.deref::()) } } @@ -592,7 +592,7 @@ impl<'w> UnsafeEntityCell<'w> { // SAFETY: // - entity location is valid - // - proper world acess is promised by caller + // - proper world access is promised by caller unsafe { get_ticks( self.world, diff --git a/crates/bevy_pbr/src/environment_map/mod.rs b/crates/bevy_pbr/src/environment_map/mod.rs index adf0bea91e..5e8b42196f 100644 --- a/crates/bevy_pbr/src/environment_map/mod.rs +++ b/crates/bevy_pbr/src/environment_map/mod.rs @@ -53,7 +53,7 @@ pub struct EnvironmentMapLight { } impl EnvironmentMapLight { - /// Whether or not all textures neccesary to use the environment map + /// Whether or not all textures necessary to use the environment map /// have been loaded by the asset server. pub fn is_loaded(&self, images: &RenderAssets) -> bool { images.get(&self.diffuse_map).is_some() && images.get(&self.specular_map).is_some() diff --git a/crates/bevy_pbr/src/light.rs b/crates/bevy_pbr/src/light.rs index 5e1fe8a74a..d9599feb4c 100644 --- a/crates/bevy_pbr/src/light.rs +++ b/crates/bevy_pbr/src/light.rs @@ -277,7 +277,7 @@ fn calculate_cascade_bounds( /// Builder for [`CascadeShadowConfig`]. pub struct CascadeShadowConfigBuilder { /// The number of shadow cascades. - /// More cascades increases shadow quality by mitigating perspective aliasing - a phenomenom where areas + /// More cascades increases shadow quality by mitigating perspective aliasing - a phenomenon where areas /// nearer the camera are covered by fewer shadow map texels than areas further from the camera, causing /// blocky looking shadows. /// @@ -393,7 +393,7 @@ pub struct Cascade { pub(crate) view_transform: Mat4, /// The orthographic projection for this cascade. pub(crate) projection: Mat4, - /// The view-projection matrix for this cacade, converting world space into light clip space. + /// The view-projection matrix for this cascade, converting world space into light clip space. /// Importantly, this is derived and stored separately from `view_transform` and `projection` to /// ensure shadow stability. pub(crate) view_projection: Mat4, diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs index 89796e969f..783ee7cdfe 100644 --- a/crates/bevy_render/src/lib.rs +++ b/crates/bevy_render/src/lib.rs @@ -72,7 +72,7 @@ pub struct RenderPlugin { /// These can be useful for ordering, but you almost never want to add your systems to these sets. #[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)] pub enum RenderSet { - /// The copy of [`apply_system_buffers`] that runs at the begining of this schedule. + /// The copy of [`apply_system_buffers`] that runs at the beginning of this schedule. /// This is used for applying the commands from the [`ExtractSchedule`] ExtractCommands, /// Prepare render resources from the extracted data for the GPU. diff --git a/crates/bevy_render/src/mesh/shape/mod.rs b/crates/bevy_render/src/mesh/shape/mod.rs index beba19c687..823958e773 100644 --- a/crates/bevy_render/src/mesh/shape/mod.rs +++ b/crates/bevy_render/src/mesh/shape/mod.rs @@ -220,7 +220,7 @@ impl Plane { impl From for Mesh { fn from(plane: Plane) -> Self { - // here this is split in the z and x directions if one ever needs asymetrical subdivision + // here this is split in the z and x directions if one ever needs asymmetrical subdivision // two Plane struct fields would need to be added instead of the single subdivisions field let z_vertex_count = plane.subdivisions + 2; let x_vertex_count = plane.subdivisions + 2; diff --git a/crates/bevy_render/src/texture/fallback_image.rs b/crates/bevy_render/src/texture/fallback_image.rs index 9160dadbac..2ffe5204ac 100644 --- a/crates/bevy_render/src/texture/fallback_image.rs +++ b/crates/bevy_render/src/texture/fallback_image.rs @@ -127,7 +127,7 @@ pub struct FallbackImageMsaaCache(HashMap); /// A Cache of fallback depth textures that uses the sample count as a key /// /// # WARNING -/// Detph images are never initialized with data, therefore, +/// Depth images are never initialized with data, therefore, /// you shouldn't sample them before writing data to them first. #[derive(Resource, Deref, DerefMut, Default)] pub struct FallbackImageDepthCache(HashMap); diff --git a/crates/bevy_render/src/texture/image_texture_conversion.rs b/crates/bevy_render/src/texture/image_texture_conversion.rs index de8ed285f7..71eeff23e9 100644 --- a/crates/bevy_render/src/texture/image_texture_conversion.rs +++ b/crates/bevy_render/src/texture/image_texture_conversion.rs @@ -168,7 +168,7 @@ impl Image { ) } - /// Convert a [`Image`] to a [`DynamicImage`]. Usefull for editing image + /// Convert a [`Image`] to a [`DynamicImage`]. Useful for editing image /// data. Not all [`TextureFormat`] are covered, therefore it will return an /// error if the format is unsupported. Supported formats are: /// - `TextureFormat::R8Unorm` diff --git a/crates/bevy_tasks/src/task_pool.rs b/crates/bevy_tasks/src/task_pool.rs index 4ccd952135..4f37a8f34f 100644 --- a/crates/bevy_tasks/src/task_pool.rs +++ b/crates/bevy_tasks/src/task_pool.rs @@ -286,7 +286,7 @@ impl TaskPool { /// /// When `tick_task_pool_executor` is set to `true`, the multithreaded task stealing executor is ticked on the scope /// thread. Disabling this can be useful when finishing the scope is latency sensitive. Pulling tasks from - /// global excutor can run tasks unrelated to the scope and delay when the scope returns. + /// global executor can run tasks unrelated to the scope and delay when the scope returns. /// /// See [`Self::scope`] for more details in general about how scopes work. pub fn scope_with_executor<'env, F, T>( diff --git a/crates/bevy_time/src/fixed_timestep.rs b/crates/bevy_time/src/fixed_timestep.rs index 7fa9d6ff2c..c410c9ac45 100644 --- a/crates/bevy_time/src/fixed_timestep.rs +++ b/crates/bevy_time/src/fixed_timestep.rs @@ -27,7 +27,7 @@ use bevy_ecs::{system::Resource, world::World}; use bevy_utils::Duration; use thiserror::Error; -/// The amount of time that must pass before the fixed timstep schedule is run again. +/// The amount of time that must pass before the fixed timestep schedule is run again. #[derive(Resource, Debug)] pub struct FixedTime { accumulated: Duration, diff --git a/crates/bevy_utils/src/synccell.rs b/crates/bevy_utils/src/synccell.rs index 55102dede4..0ea76cac62 100644 --- a/crates/bevy_utils/src/synccell.rs +++ b/crates/bevy_utils/src/synccell.rs @@ -47,5 +47,5 @@ impl SyncCell { // SAFETY: `Sync` only allows multithreaded access via immutable reference. // As `SyncCell` requires an exclusive reference to access the wrapped value for `!Sync` types, -// marking this type as `Sync` does not actually allow unsychronized access to the inner value. +// marking this type as `Sync` does not actually allow unsynchronized access to the inner value. unsafe impl Sync for SyncCell {}