Skip to content

Commit

Permalink
fix some typos (#12038)
Browse files Browse the repository at this point in the history
# Objective

Split - containing only the fixed typos

-
#12036 (review)


# Migration Guide
In `crates/bevy_mikktspace/src/generated.rs` 

```rs
// before
pub struct SGroup {
    pub iVertexRepresentitive: i32,
    ..
}

// after
pub struct SGroup {
    pub iVertexRepresentative: i32,
    ..
}
```

In `crates/bevy_core_pipeline/src/core_2d/mod.rs`

```rs
// before
Node2D::ConstrastAdaptiveSharpening

// after
Node2D::ContrastAdaptiveSharpening
```

---------

Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: James Liu <[email protected]>
Co-authored-by: François <[email protected]>
  • Loading branch information
4 people authored Feb 22, 2024
1 parent 5d3f66f commit 9d67edc
Show file tree
Hide file tree
Showing 34 changed files with 72 additions and 72 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,8 @@ impl App {
/// (conflicting access but indeterminate order) with systems in `set`.
///
/// When possible, do this directly in the `.add_systems(Update, a.ambiguous_with(b))` call.
/// However, sometimes two independant plugins `A` and `B` are reported as ambiguous, which you
/// can only supress as the consumer of both.
/// However, sometimes two independent plugins `A` and `B` are reported as ambiguous, which you
/// can only suppress as the consumer of both.
#[track_caller]
pub fn ignore_ambiguity<M1, M2, S1, S2>(
&mut self,
Expand Down
10 changes: 5 additions & 5 deletions crates/bevy_asset/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub enum ParseAssetPathError {
/// Error that occurs when the [`AssetPath::label`] section of a path string contains the [`AssetPath::source`] delimiter `://`. E.g. `source://file.test#bad://label`.
#[error("Asset label must not contain a `://` substring")]
InvalidLabelSyntax,
/// Error that occurs when a path string has an [`AssetPath::source`] delimiter `://` with no characters preceeding it. E.g. `://file.test`.
/// Error that occurs when a path string has an [`AssetPath::source`] delimiter `://` with no characters preceding it. E.g. `://file.test`.
#[error("Asset source must be at least one character. Either specify the source before the '://' or remove the `://`")]
MissingSource,
/// Error that occurs when a path string has an [`AssetPath::label`] delimiter `#` with no characters succeeding it. E.g. `file.test#`
Expand Down Expand Up @@ -143,9 +143,9 @@ impl<'a> AssetPath<'a> {
let mut label_range = None;

// Loop through the characters of the passed in &str to accomplish the following:
// 1. Seach for the first instance of the `://` substring. If the `://` substring is found,
// 1. Search for the first instance of the `://` substring. If the `://` substring is found,
// store the range of indices representing everything before the `://` substring as the `source_range`.
// 2. Seach for the last instance of the `#` character. If the `#` character is found,
// 2. Search for the last instance of the `#` character. If the `#` character is found,
// store the range of indices representing everything after the `#` character as the `label_range`
// 3. Set the `path_range` to be everything in between the `source_range` and `label_range`,
// excluding the `://` substring and `#` character.
Expand All @@ -165,7 +165,7 @@ impl<'a> AssetPath<'a> {
2 => {
// If we haven't found our first `AssetPath::source` yet, check to make sure it is valid and then store it.
if source_range.is_none() {
// If the `AssetPath::source` containes a `#` character, it is invalid.
// If the `AssetPath::source` contains a `#` character, it is invalid.
if label_range.is_some() {
return Err(ParseAssetPathError::InvalidSourceSyntax);
}
Expand Down Expand Up @@ -833,7 +833,7 @@ mod tests {

#[test]
fn test_resolve_implicit_relative() {
// A path with no inital directory separator should be considered relative.
// A path with no initial directory separator should be considered relative.
let base = AssetPath::from("alice/bob#carol");
assert_eq!(
base.resolve("joe/next").unwrap(),
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_asset/src/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub trait AssetTransformer: Send + Sync + 'static {
/// The type of [error](`std::error::Error`) which could be encountered by this transformer.
type Error: Into<Box<dyn std::error::Error + Send + Sync + 'static>>;

/// Transformes the given [`TransformedAsset`] to [`AssetTransformer::AssetOutput`].
/// Transforms the given [`TransformedAsset`] to [`AssetTransformer::AssetOutput`].
/// The [`TransformedAsset`]'s `labeled_assets` can be altered to add new Labeled Sub-Assets
/// The passed in `settings` can influence how the `asset` is transformed
fn transform<'a>(
Expand Down Expand Up @@ -58,7 +58,7 @@ impl<A: Asset> TransformedAsset<A> {
}
None
}
/// Creates a new [`TransformedAsset`] from `asset`, transfering the `labeled_assets` from this [`TransformedAsset`] to the new one
/// Creates a new [`TransformedAsset`] from `asset`, transferring the `labeled_assets` from this [`TransformedAsset`] to the new one
pub fn replace_asset<B: Asset>(self, asset: B) -> TransformedAsset<B> {
TransformedAsset {
value: asset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,17 @@ impl Plugin for CASPlugin {
}
{
render_app
.add_render_graph_node::<CASNode>(Core2d, Node2d::ConstrastAdaptiveSharpening)
.add_render_graph_node::<CASNode>(Core2d, Node2d::ContrastAdaptiveSharpening)
.add_render_graph_edge(
Core2d,
Node2d::Tonemapping,
Node2d::ConstrastAdaptiveSharpening,
Node2d::ContrastAdaptiveSharpening,
)
.add_render_graph_edges(
Core2d,
(
Node2d::Fxaa,
Node2d::ConstrastAdaptiveSharpening,
Node2d::ContrastAdaptiveSharpening,
Node2d::EndMainPassPostProcessing,
),
);
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_core_pipeline/src/core_2d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub mod graph {
Tonemapping,
Fxaa,
Upscaling,
ConstrastAdaptiveSharpening,
ContrastAdaptiveSharpening,
EndMainPassPostProcessing,
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/identifier/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::fmt;

/// An Error type for [`super::Identifier`], mostly for providing error
/// handling for convertions of an ID to a type abstracting over the ID bits.
/// handling for conversions of an ID to a type abstracting over the ID bits.
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[non_exhaustive]
pub enum IdentifierError {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/identifier/masks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl IdentifierMask {
let overflowed = lo >> 31;

// SAFETY:
// - Adding the overflow flag will offet overflows to start at 1 instead of 0
// - Adding the overflow flag will offset overflows to start at 1 instead of 0
// - The sum of `0x7FFF_FFFF` + `u32::MAX` + 1 (overflow) == `0x7FFF_FFFF`
// - If the operation doesn't overflow at 31 bits, no offsetting takes place
unsafe { NonZeroU32::new_unchecked(lo.wrapping_add(overflowed) & HIGH_MASK) }
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/query/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl<'w, D: QueryData, F: QueryFilter> QueryBuilder<'w, D, F> {
}

/// Transmute the existing builder adding required accesses.
/// This will maintain all exisiting accesses.
/// This will maintain all existing accesses.
///
/// If including a filter type see [`Self::transmute_filtered`]
pub fn transmute<NewD: QueryData>(&mut self) -> &mut QueryBuilder<'w, NewD> {
Expand All @@ -233,7 +233,7 @@ impl<'w, D: QueryData, F: QueryFilter> QueryBuilder<'w, D, F> {

self.extend_access(access);
// SAFETY:
// - We have included all required acceses for NewQ and NewF
// - We have included all required accesses for NewQ and NewF
// - The layout of all QueryBuilder instances is the same
unsafe { std::mem::transmute(self) }
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/query/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
Func: FnMut(D::Item<'w>),
{
// SAFETY: Caller assures that D::IS_DENSE and F::IS_DENSE are true, that table matches D and F
// and all indicies in rows are in range.
// and all indices in rows are in range.
unsafe {
self.fold_over_table_range((), &mut |_, item| func(item), table, rows);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/reflect/from_world.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Definitions for [`FromWorld`] reflection.
//! This allows creating instaces of types that are known only at runtime and
//! This allows creating instances of types that are known only at runtime and
//! require an `&mut World` to be initialized.
//!
//! This module exports two types: [`ReflectFromWorldFns`] and [`ReflectFromWorld`].
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/schedule/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ where
///
/// Ordering constraints will be applied between the successive elements.
///
/// If the preceeding node on a edge has deferred parameters, a [`apply_deferred`](crate::schedule::apply_deferred)
/// If the preceding node on a edge has deferred parameters, a [`apply_deferred`](crate::schedule::apply_deferred)
/// will be inserted on the edge. If this behavior is not desired consider using
/// [`chain_ignore_deferred`](Self::chain_ignore_deferred) instead.
fn chain(self) -> SystemConfigs {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/schedule/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ fn make_executor(kind: ExecutorKind) -> Box<dyn SystemExecutor> {
/// Chain systems into dependencies
#[derive(PartialEq)]
pub enum Chain {
/// Run nodes in order. If there are deferred parameters in preceeding systems a
/// Run nodes in order. If there are deferred parameters in preceding systems a
/// [`apply_deferred`] will be added on the edge.
Yes,
/// Run nodes in order. This will not add [`apply_deferred`] between nodes.
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/system/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
/// ## Allowed Transmutes
///
/// Besides removing parameters from the query, you can also
/// make limited changes to the types of paramters.
/// make limited changes to the types of parameters.
///
/// * Can always add/remove `Entity`
/// * `Ref<T>` <-> `&T`
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ unsafe impl SystemParam for &'_ World {
/// # use bevy_ecs::system::assert_is_system;
/// struct Config(u32);
/// #[derive(Resource)]
/// struct Myu32Wrapper(u32);
/// fn reset_to_system(value: Config) -> impl FnMut(ResMut<Myu32Wrapper>) {
/// struct MyU32Wrapper(u32);
/// fn reset_to_system(value: Config) -> impl FnMut(ResMut<MyU32Wrapper>) {
/// move |mut val| val.0 = value.0
/// }
///
Expand Down
10 changes: 5 additions & 5 deletions crates/bevy_gizmos/src/primitives/dim3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,9 @@ pub struct ConicalFrustum3dBuilder<'a, 'w, 's, T: GizmoConfigGroup> {

// Center of conical frustum, half-way between the top and the bottom
position: Vec3,
// Rotation of the conical frustrum
// Rotation of the conical frustum
//
// default orientation is: conical frustrum base shape normals are aligned with `Vec3::Y` axis
// default orientation is: conical frustum base shape normals are aligned with `Vec3::Y` axis
rotation: Quat,
// Color of the conical frustum
color: Color,
Expand Down Expand Up @@ -760,7 +760,7 @@ impl<T: GizmoConfigGroup> Drop for ConicalFrustum3dBuilder<'_, '_, '_, T> {
let half_height = *height * 0.5;
let normal = *rotation * Vec3::Y;

// draw the two circles of the conical frustrum
// draw the two circles of the conical frustum
[(*radius_top, half_height), (*radius_bottom, -half_height)]
.into_iter()
.for_each(|(radius, height)| {
Expand All @@ -774,7 +774,7 @@ impl<T: GizmoConfigGroup> Drop for ConicalFrustum3dBuilder<'_, '_, '_, T> {
);
});

// connect the two circles of the conical frustrum
// connect the two circles of the conical frustum
circle_coordinates(*radius_top, *segments)
.map(move |p| Vec3::new(p.x, half_height, p.y))
.zip(
Expand Down Expand Up @@ -802,7 +802,7 @@ pub struct Torus3dBuilder<'a, 'w, 's, T: GizmoConfigGroup> {

// Center of the torus
position: Vec3,
// Rotation of the conical frustrum
// Rotation of the conical frustum
//
// default orientation is: major circle normal is aligned with `Vec3::Y` axis
rotation: Quat,
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_input/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// the W3C short notice apply to the `KeyCode` enums and their variants and the
// documentation attached to their variants.

// --------- BEGGINING OF W3C LICENSE --------------------------------------------------------------
// --------- BEGINNING OF W3C LICENSE --------------------------------------------------------------
//
// License
//
Expand Down Expand Up @@ -51,7 +51,7 @@
//
// --------- END OF W3C LICENSE --------------------------------------------------------------------

// --------- BEGGINING OF W3C SHORT NOTICE ---------------------------------------------------------
// --------- BEGINNING OF W3C SHORT NOTICE ---------------------------------------------------------
//
// winit: https://github.com/rust-windowing/winit
//
Expand Down Expand Up @@ -886,7 +886,7 @@ pub enum Key {
Standby,
/// The WakeUp key. (`KEYCODE_WAKEUP`)
WakeUp,
/// Initate the multi-candidate mode.
/// Initiate the multi-candidate mode.
AllCandidates,
/// The Alphanumeric key (on linux/web)
Alphanumeric,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_macro_utils/src/bevy_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl BevyManifest {
///
/// # Panics
///
/// Will panic if the path is not able to be parsed. For a non-panicing option, see [`try_parse_str`]
/// Will panic if the path is not able to be parsed. For a non-panicking option, see [`try_parse_str`]
///
/// [`try_parse_str`]: Self::try_parse_str
pub fn parse_str<T: syn::parse::Parse>(path: &str) -> T {
Expand Down
18 changes: 9 additions & 9 deletions crates/bevy_mikktspace/src/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl STriInfo {
pub struct SGroup {
pub iNrFaces: i32,
pub pFaceIndices: *mut i32,
pub iVertexRepresentitive: i32,
pub iVertexRepresentative: i32,
pub bOrientPreservering: bool,
}

Expand All @@ -142,7 +142,7 @@ impl SGroup {
Self {
iNrFaces: 0,
pFaceIndices: null_mut(),
iVertexRepresentitive: 0,
iVertexRepresentative: 0,
bOrientPreservering: false,
}
}
Expand Down Expand Up @@ -560,7 +560,7 @@ unsafe fn GenerateTSpaces<I: Geometry>(
piTriListIn,
pTriInfos,
geometry,
(*pGroup).iVertexRepresentitive,
(*pGroup).iVertexRepresentative,
);
iUniqueSubGroups += 1
}
Expand Down Expand Up @@ -634,7 +634,7 @@ unsafe fn EvalTspace<I: Geometry>(
mut piTriListIn: *const i32,
mut pTriInfos: *const STriInfo,
geometry: &mut I,
iVertexRepresentitive: i32,
iVertexRepresentative: i32,
) -> STSpace {
let mut res: STSpace = STSpace {
vOs: Vec3::new(0.0, 0.0, 0.0),
Expand Down Expand Up @@ -675,11 +675,11 @@ unsafe fn EvalTspace<I: Geometry>(
let mut i0: i32 = -1i32;
let mut i1: i32 = -1i32;
let mut i2: i32 = -1i32;
if *piTriListIn.offset((3i32 * f + 0i32) as isize) == iVertexRepresentitive {
if *piTriListIn.offset((3i32 * f + 0i32) as isize) == iVertexRepresentative {
i = 0i32
} else if *piTriListIn.offset((3i32 * f + 1i32) as isize) == iVertexRepresentitive {
} else if *piTriListIn.offset((3i32 * f + 1i32) as isize) == iVertexRepresentative {
i = 1i32
} else if *piTriListIn.offset((3i32 * f + 2i32) as isize) == iVertexRepresentitive {
} else if *piTriListIn.offset((3i32 * f + 2i32) as isize) == iVertexRepresentative {
i = 2i32
}
index = *piTriListIn.offset((3i32 * f + i) as isize);
Expand Down Expand Up @@ -831,7 +831,7 @@ unsafe fn Build4RuleGroups(
let ref mut fresh2 = (*pTriInfos.offset(f as isize)).AssignedGroup[i as usize];
*fresh2 = &mut *pGroups.offset(iNrActiveGroups as isize) as *mut SGroup;
(*(*pTriInfos.offset(f as isize)).AssignedGroup[i as usize])
.iVertexRepresentitive = vert_index;
.iVertexRepresentative = vert_index;
(*(*pTriInfos.offset(f as isize)).AssignedGroup[i as usize]).bOrientPreservering =
(*pTriInfos.offset(f as isize)).iFlag & 8i32 != 0i32;
(*(*pTriInfos.offset(f as isize)).AssignedGroup[i as usize]).iNrFaces = 0i32;
Expand Down Expand Up @@ -897,7 +897,7 @@ unsafe fn AssignRecur(
let mut pMyTriInfo: *mut STriInfo =
&mut *psTriInfos.offset(iMyTriIndex as isize) as *mut STriInfo;
// track down vertex
let iVertRep: i32 = (*pGroup).iVertexRepresentitive;
let iVertRep: i32 = (*pGroup).iVertexRepresentative;
let mut pVerts: *const i32 =
&*piTriListIn.offset((3i32 * iMyTriIndex + 0i32) as isize) as *const i32;
let mut i: i32 = -1i32;
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_pbr/src/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ pub struct MaterialBindGroupId(Option<BindGroupId>);
pub struct AtomicMaterialBindGroupId(AtomicU32);

impl AtomicMaterialBindGroupId {
/// Stores a value atomically. Uses [`Ordering::Relaxed`] so there is zero guarentee of ordering
/// Stores a value atomically. Uses [`Ordering::Relaxed`] so there is zero guarantee of ordering
/// relative to other operations.
///
/// See also: [`AtomicU32::store`].
Expand All @@ -815,7 +815,7 @@ impl AtomicMaterialBindGroupId {
self.0.store(id, Ordering::Relaxed);
}

/// Loads a value atomically. Uses [`Ordering::Relaxed`] so there is zero guarentee of ordering
/// Loads a value atomically. Uses [`Ordering::Relaxed`] so there is zero guarantee of ordering
/// relative to other operations.
///
/// See also: [`AtomicU32::load`].
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/pbr_material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ pub struct StandardMaterial {
/// | Flint Glass | 1.69 |
/// | Ruby | 1.71 |
/// | Glycerine | 1.74 |
/// | Saphire | 1.77 |
/// | Sapphire | 1.77 |
/// | Cubic Zirconia | 2.15 |
/// | Diamond | 2.42 |
/// | Moissanite | 2.65 |
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/bevy_reflect_derive/src/utility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ impl FromIterator<StringExpr> for StringExpr {
}
}

/// Returns a [`syn::parse::Parser`] which parses a stream of zero or more occurences of `T`
/// Returns a [`syn::parse::Parser`] which parses a stream of zero or more occurrences of `T`
/// separated by punctuation of type `P`, with optional trailing punctuation.
///
/// This is functionally the same as [`Punctuated::parse_terminated`],
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ bevy_reflect::tests::Test {
}

#[test]
fn should_allow_custom_where_wtih_assoc_type() {
fn should_allow_custom_where_with_assoc_type() {
trait Trait {
type Assoc;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/path/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'a> AccessError<'a> {
&self.kind
}

/// The returns the [`Access`] that this [`AccessError`] occured in.
/// The returns the [`Access`] that this [`AccessError`] occurred in.
pub const fn access(&self) -> &Access {
&self.access
}
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_reflect/src/path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ pub enum ReflectPathError<'a> {
InvalidDowncast,

/// An error caused by an invalid path string that couldn't be parsed.
#[error("Encounted an error at offset {offset} while parsing `{path}`: {error}")]
#[error("Encountered an error at offset {offset} while parsing `{path}`: {error}")]
ParseError {
/// Position in `path`.
offset: usize,
/// The path that the error occured in.
/// The path that the error occurred in.
path: &'a str,
/// The underlying error.
error: ParseError<'a>,
Expand Down
Loading

0 comments on commit 9d67edc

Please sign in to comment.