Skip to content

Commit 7e29da9

Browse files
authored
casted -> cast and downcasted -> downcast spelling. (#20669)
# Objective correct spelling of `cast` and `downcast` (past tense). the incorrect spelling `casted` and `downcasted` appears a few times in comments and doc, notably https://dev-docs.bevy.org/bevy/prelude/trait.Reflect.html#method.is https://dev-docs.bevy.org/bevy/picking/backend/struct.HitData.html#structfield.camera https://dev-docs.bevy.org/bevy/picking/mesh_picking/ray_cast/enum.RayCastVisibility.html#variant.Any ## Solution `rg 'casted'` in project root `s/casted/cast/g` ## Testing This affects comments and doc-comments only.
1 parent 7b62e85 commit 7e29da9

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

crates/bevy_ecs/src/entity/unique_slice.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ pub const unsafe fn from_raw_parts_mut<'a, T: EntityEquivalent>(
913913
///
914914
/// # Safety
915915
///
916-
/// All elements in each of the casted slices must be unique.
916+
/// All elements in each of the cast slices must be unique.
917917
pub unsafe fn cast_slice_of_unique_entity_slice<'a, 'b, T: EntityEquivalent + 'a>(
918918
slice: &'b [&'a [T]],
919919
) -> &'b [&'a UniqueEntityEquivalentSlice<T>] {
@@ -925,7 +925,7 @@ pub unsafe fn cast_slice_of_unique_entity_slice<'a, 'b, T: EntityEquivalent + 'a
925925
///
926926
/// # Safety
927927
///
928-
/// All elements in each of the casted slices must be unique.
928+
/// All elements in each of the cast slices must be unique.
929929
pub unsafe fn cast_slice_of_unique_entity_slice_mut<'a, 'b, T: EntityEquivalent + 'a>(
930930
slice: &'b mut [&'a [T]],
931931
) -> &'b mut [&'a UniqueEntityEquivalentSlice<T>] {
@@ -937,7 +937,7 @@ pub unsafe fn cast_slice_of_unique_entity_slice_mut<'a, 'b, T: EntityEquivalent
937937
///
938938
/// # Safety
939939
///
940-
/// All elements in each of the casted slices must be unique.
940+
/// All elements in each of the cast slices must be unique.
941941
pub unsafe fn cast_slice_of_mut_unique_entity_slice_mut<'a, 'b, T: EntityEquivalent + 'a>(
942942
slice: &'b mut [&'a mut [T]],
943943
) -> &'b mut [&'a mut UniqueEntityEquivalentSlice<T>] {

crates/bevy_picking/src/backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl PointerHits {
9999
#[reflect(Clone, PartialEq)]
100100
pub struct HitData {
101101
/// The camera entity used to detect this hit. Useful when you need to find the ray that was
102-
/// casted for this hit when using a raycasting backend.
102+
/// cast for this hit when using a raycasting backend.
103103
pub camera: Entity,
104104
/// `depth` only needs to be self-consistent with other [`PointerHits`]s using the same
105105
/// [`RenderTarget`](bevy_camera::RenderTarget). However, it is recommended to use the

crates/bevy_picking/src/mesh_picking/ray_cast/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use tracing::*;
2727
#[derive(Clone, Copy, Reflect)]
2828
#[reflect(Clone)]
2929
pub enum RayCastVisibility {
30-
/// Completely ignore visibility checks. Hidden items can still be ray casted against.
30+
/// Completely ignore visibility checks. Hidden items can still be ray cast against.
3131
Any,
3232
/// Only cast rays against entities that are visible in the hierarchy. See [`Visibility`](bevy_camera::visibility::Visibility).
3333
Visible,

crates/bevy_reflect/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ println!("{}", my_trait.do_thing());
160160

161161
// This works because the #[reflect(MyTrait)] we put on MyType informed the Reflect derive to insert a new instance
162162
// of ReflectDoThing into MyType's registration. The instance knows how to cast &dyn Reflect to &dyn DoThing, because it
163-
// knows that &dyn Reflect should first be downcasted to &MyType, which can then be safely casted to &dyn DoThing
163+
// knows that &dyn Reflect should first be downcast to &MyType, which can then be safely cast to &dyn DoThing
164164
```
165165

166166
## Why make this?

crates/bevy_reflect/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
//! This means values implementing `PartialReflect` can be dynamically constructed and introspected.
6060
//! * The `Reflect` trait, however, ensures that the interface exposed by `PartialReflect`
6161
//! on types which additionally implement `Reflect` mirrors the structure of a single Rust type.
62-
//! * This means `dyn Reflect` trait objects can be directly downcasted to concrete types,
62+
//! * This means `dyn Reflect` trait objects can be directly downcast to concrete types,
6363
//! where `dyn PartialReflect` trait object cannot.
6464
//! * `Reflect`, since it provides a stronger type-correctness guarantee,
6565
//! is the trait used to interact with [the type registry].

crates/bevy_reflect/src/reflect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,9 @@ impl dyn Reflect {
546546
/// otherwise.
547547
///
548548
/// The underlying value is the concrete type that is stored in this `dyn` object;
549-
/// it can be downcasted to. In the case that this underlying value "represents"
549+
/// it can be downcast to. In the case that this underlying value "represents"
550550
/// a different type, like the Dynamic\*\*\* types do, you can call `represents`
551-
/// to determine what type they represent. Represented types cannot be downcasted
551+
/// to determine what type they represent. Represented types cannot be downcast
552552
/// to, but you can use [`FromReflect`] to create a value of the represented type from them.
553553
///
554554
/// For remote types, `T` should be the type itself rather than the wrapper type.

0 commit comments

Comments
 (0)