Fix a few typos (#17292)
# Objective Stumbled upon a `from <-> form` transposition while reviewing a PR, thought it was interesting, and went down a bit of a rabbit hole. ## Solution Fix em
This commit is contained in:
parent
a5279d340d
commit
b77e3ef33a
@ -18,7 +18,7 @@ pub struct BlendInput<T> {
|
||||
|
||||
/// An animatable value type.
|
||||
pub trait Animatable: Reflect + Sized + Send + Sync + 'static {
|
||||
/// Interpolates between `a` and `b` with a interpolation factor of `time`.
|
||||
/// Interpolates between `a` and `b` with an interpolation factor of `time`.
|
||||
///
|
||||
/// The `time` parameter here may not be clamped to the range `[0.0, 1.0]`.
|
||||
fn interpolate(a: &Self, b: &Self, time: f32) -> Self;
|
||||
|
@ -469,7 +469,7 @@ pub enum AnimationEvaluationError {
|
||||
/// An animation that an [`AnimationPlayer`] is currently either playing or was
|
||||
/// playing, but is presently paused.
|
||||
///
|
||||
/// An stopped animation is considered no longer active.
|
||||
/// A stopped animation is considered no longer active.
|
||||
#[derive(Debug, Clone, Copy, Reflect)]
|
||||
pub struct ActiveAnimation {
|
||||
/// The factor by which the weight from the [`AnimationGraph`] is multiplied.
|
||||
|
@ -1357,7 +1357,7 @@ pub enum AppExit {
|
||||
}
|
||||
|
||||
impl AppExit {
|
||||
/// Creates a [`AppExit::Error`] with a error code of 1.
|
||||
/// Creates a [`AppExit::Error`] with an error code of 1.
|
||||
#[must_use]
|
||||
pub const fn error() -> Self {
|
||||
Self::Error(NonZero::<u8>::MIN)
|
||||
@ -1733,7 +1733,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn app_exit_size() {
|
||||
// There wont be many of them so the size isn't a issue but
|
||||
// There wont be many of them so the size isn't an issue but
|
||||
// it's nice they're so small let's keep it that way.
|
||||
assert_eq!(size_of::<AppExit>(), size_of::<u8>());
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ impl<'w, A: AsAssetId> AssetChangeCheck<'w, A> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Filter that selects entities with a `A` for an asset that changed
|
||||
/// Filter that selects entities with an `A` for an asset that changed
|
||||
/// after the system last ran, where `A` is a component that implements
|
||||
/// [`AsAssetId`].
|
||||
///
|
||||
@ -114,8 +114,8 @@ impl<'w, A: AsAssetId> AssetChangeCheck<'w, A> {
|
||||
/// # Performance
|
||||
///
|
||||
/// When at least one `A` is updated, this will
|
||||
/// read a hashmap once per entity with a `A` component. The
|
||||
/// runtime of the query is proportional to how many entities with a `A`
|
||||
/// read a hashmap once per entity with an `A` component. The
|
||||
/// runtime of the query is proportional to how many entities with an `A`
|
||||
/// it matches.
|
||||
///
|
||||
/// If no `A` asset updated since the last time the system ran, then no lookups occur.
|
||||
|
@ -429,7 +429,7 @@ const SMAA_CORNER_ROUNDING: u32 = 25u;
|
||||
// "SMAA Presets".)
|
||||
|
||||
/**
|
||||
* If there is an neighbor edge that has SMAA_LOCAL_CONTRAST_FACTOR times
|
||||
* If there is a neighbor edge that has SMAA_LOCAL_CONTRAST_FACTOR times
|
||||
* bigger contrast than current edge, current edge will be discarded.
|
||||
*
|
||||
* This allows to eliminate spurious crossing edges, and is based on the fact
|
||||
|
@ -55,7 +55,7 @@ fn prepare_view_upscaling_pipelines(
|
||||
|
||||
match blend_state {
|
||||
None => {
|
||||
// If we've already seen this output for a camera and it doesn't have a output blend
|
||||
// If we've already seen this output for a camera and it doesn't have an output blend
|
||||
// mode configured, default to alpha blend so that we don't accidentally overwrite
|
||||
// the output texture
|
||||
if already_seen {
|
||||
|
@ -126,7 +126,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
|
||||
}
|
||||
|
||||
/// Executes the equivalent of [`Iterator::fold`] over a contiguous segment
|
||||
/// from an storage.
|
||||
/// from a storage.
|
||||
///
|
||||
/// # Safety
|
||||
/// - `range` must be in `[0, storage::entity_count)` or None.
|
||||
@ -187,7 +187,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
|
||||
}
|
||||
|
||||
/// Executes the equivalent of [`Iterator::fold`] over a contiguous segment
|
||||
/// from an table.
|
||||
/// from a table.
|
||||
///
|
||||
/// # Safety
|
||||
/// - all `rows` must be in `[0, table.entity_count)`.
|
||||
|
@ -116,7 +116,7 @@ pub unsafe trait WorldQuery {
|
||||
/// Fetch [`Self::Item`](`WorldQuery::Item`) for either the given `entity` in the current [`Table`],
|
||||
/// or for the given `entity` in the current [`Archetype`]. This must always be called after
|
||||
/// [`WorldQuery::set_table`] with a `table_row` in the range of the current [`Table`] or after
|
||||
/// [`WorldQuery::set_archetype`] with a `entity` in the current archetype.
|
||||
/// [`WorldQuery::set_archetype`] with an `entity` in the current archetype.
|
||||
/// Accesses components registered in [`WorldQuery::update_component_access`].
|
||||
///
|
||||
/// # Safety
|
||||
|
@ -431,7 +431,7 @@ where
|
||||
///
|
||||
/// Ordering constraints will be applied between the successive elements.
|
||||
///
|
||||
/// If the preceding node on a edge has deferred parameters, a [`ApplyDeferred`](crate::schedule::ApplyDeferred)
|
||||
/// If the preceding node on an edge has deferred parameters, an [`ApplyDeferred`](crate::schedule::ApplyDeferred)
|
||||
/// 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 {
|
||||
|
@ -32,7 +32,7 @@ pub type DiGraph<S = FixedHasher> = Graph<true, S>;
|
||||
/// `Graph<DIRECTED>` is a graph datastructure using an associative array
|
||||
/// of its node weights `NodeId`.
|
||||
///
|
||||
/// It uses an combined adjacency list and sparse adjacency matrix
|
||||
/// It uses a combined adjacency list and sparse adjacency matrix
|
||||
/// representation, using **O(|N| + |E|)** space, and allows testing for edge
|
||||
/// existence in constant time.
|
||||
///
|
||||
|
@ -85,11 +85,11 @@ impl TableId {
|
||||
}
|
||||
}
|
||||
|
||||
/// A opaque newtype for rows in [`Table`]s. Specifies a single row in a specific table.
|
||||
/// An opaque newtype for rows in [`Table`]s. Specifies a single row in a specific table.
|
||||
///
|
||||
/// Values of this type are retrievable from [`Archetype::entity_table_row`] and can be
|
||||
/// used alongside [`Archetype::table_id`] to fetch the exact table and row where an
|
||||
/// [`Entity`]'s
|
||||
/// [`Entity`]'s components are stored.
|
||||
///
|
||||
/// Values of this type are only valid so long as entities have not moved around.
|
||||
/// Adding and removing components from an entity, or despawning it will invalidate
|
||||
@ -183,7 +183,7 @@ impl TableBuilder {
|
||||
/// A column-oriented [structure-of-arrays] based storage for [`Component`]s of entities
|
||||
/// in a [`World`].
|
||||
///
|
||||
/// Conceptually, a `Table` can be thought of as an `HashMap<ComponentId, Column>`, where
|
||||
/// Conceptually, a `Table` can be thought of as a `HashMap<ComponentId, Column>`, where
|
||||
/// each [`ThinColumn`] is a type-erased `Vec<T: Component>`. Each row corresponds to a single entity
|
||||
/// (i.e. index 3 in Column A and index 3 in Column B point to different components on the same
|
||||
/// entity). Fetching components from a table involves fetching the associated column for a
|
||||
|
@ -240,7 +240,7 @@ unsafe impl<'w, 's, D: QueryData + 'static, F: QueryFilter + 'static>
|
||||
/// .build_state(&mut world)
|
||||
/// .build_system(|query: Query<()>| {
|
||||
/// for _ in &query {
|
||||
/// // This only includes entities with an `Player` component.
|
||||
/// // This only includes entities with a `Player` component.
|
||||
/// }
|
||||
/// });
|
||||
///
|
||||
|
@ -413,7 +413,7 @@ where
|
||||
Config: GizmoConfigGroup,
|
||||
Clear: 'static + Send + Sync,
|
||||
{
|
||||
/// Set the number of lines used to approximate the top an bottom of the cylinder geometry.
|
||||
/// Set the number of lines used to approximate the top and bottom of the cylinder geometry.
|
||||
pub fn resolution(mut self, resolution: u32) -> Self {
|
||||
self.resolution = resolution;
|
||||
self
|
||||
|
@ -15,7 +15,7 @@ pub(crate) fn single_circle_coordinate(radius: f32, resolution: u32, nth_point:
|
||||
|
||||
/// Generates an iterator over the coordinates of a circle.
|
||||
///
|
||||
/// The coordinates form a open circle, meaning the first and last points aren't the same.
|
||||
/// The coordinates form an open circle, meaning the first and last points aren't the same.
|
||||
///
|
||||
/// This function creates an iterator that yields the positions of points approximating a
|
||||
/// circle with the given radius, divided into linear segments. The iterator produces `resolution`
|
||||
|
@ -1805,7 +1805,7 @@ fn texture_sampler(texture: &gltf::Texture) -> ImageSamplerDescriptor {
|
||||
}
|
||||
}
|
||||
|
||||
/// Maps the texture address mode form glTF to wgpu.
|
||||
/// Maps the texture address mode from glTF to wgpu.
|
||||
fn texture_address_mode(gltf_address_mode: &WrappingMode) -> ImageAddressMode {
|
||||
match gltf_address_mode {
|
||||
WrappingMode::ClampToEdge => ImageAddressMode::ClampToEdge,
|
||||
@ -1814,7 +1814,7 @@ fn texture_address_mode(gltf_address_mode: &WrappingMode) -> ImageAddressMode {
|
||||
}
|
||||
}
|
||||
|
||||
/// Maps the `primitive_topology` form glTF to `wgpu`.
|
||||
/// Maps the `primitive_topology` from glTF to `wgpu`.
|
||||
#[expect(
|
||||
clippy::result_large_err,
|
||||
reason = "`GltfError` is only barely past the threshold for large errors."
|
||||
|
@ -2,7 +2,7 @@ use crate::ButtonInput;
|
||||
use bevy_ecs::system::Res;
|
||||
use core::hash::Hash;
|
||||
|
||||
/// Stateful run condition that can be toggled via a input press using [`ButtonInput::just_pressed`].
|
||||
/// Stateful run condition that can be toggled via an input press using [`ButtonInput::just_pressed`].
|
||||
///
|
||||
/// ```no_run
|
||||
/// # use bevy_app::{App, NoopPluginGroup as DefaultPlugins, Update};
|
||||
|
@ -651,7 +651,7 @@ mod tests {
|
||||
let apothem = ops::sqrt(3.0) / 2.0;
|
||||
let inv_sqrt_3 = ops::sqrt(3.0).recip();
|
||||
let tests = [
|
||||
// Test case: An sector whose arc is minor, but whose bounding circle is not the circumcircle of the endpoints and center
|
||||
// Test case: A sector whose arc is minor, but whose bounding circle is not the circumcircle of the endpoints and center
|
||||
TestCase {
|
||||
name: "1/3rd circle",
|
||||
arc: Arc2d::from_radians(1.0, TAU / 3.0),
|
||||
|
@ -147,7 +147,7 @@ pub enum EvenCoreError {
|
||||
},
|
||||
|
||||
/// Unbounded domains are not compatible with `EvenCore`.
|
||||
#[error("Cannot create a EvenCore over an unbounded domain")]
|
||||
#[error("Cannot create an EvenCore over an unbounded domain")]
|
||||
UnboundedDomain,
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ pub mod light_consts {
|
||||
pub const OFFICE: f32 = 320.;
|
||||
/// The amount of light (lux) during sunrise or sunset on a clear day.
|
||||
pub const CLEAR_SUNRISE: f32 = 400.;
|
||||
/// The amount of light (lux) on a overcast day; typical TV studio lighting
|
||||
/// The amount of light (lux) on an overcast day; typical TV studio lighting
|
||||
pub const OVERCAST_DAY: f32 = 1000.;
|
||||
/// The amount of light (lux) from ambient daylight (not direct sunlight).
|
||||
pub const AMBIENT_DAYLIGHT: f32 = 10_000.;
|
||||
|
@ -203,7 +203,7 @@ fn apply_global_wireframe_material(
|
||||
}
|
||||
}
|
||||
|
||||
/// Gets an handle to a wireframe material with a fallback on the default material
|
||||
/// Gets a handle to a wireframe material with a fallback on the default material
|
||||
fn get_wireframe_material(
|
||||
maybe_color: Option<&WireframeColor>,
|
||||
wireframe_materials: &mut Assets<WireframeMaterial>,
|
||||
|
@ -17,7 +17,7 @@ use crate::utility::NonGenericTypeInfoCell;
|
||||
#[derive(Error, Debug)]
|
||||
pub enum ApplyError {
|
||||
#[error("attempted to apply `{from_kind}` to `{to_kind}`")]
|
||||
/// Attempted to apply the wrong [kind](ReflectKind) to a type, e.g. a struct to a enum.
|
||||
/// Attempted to apply the wrong [kind](ReflectKind) to a type, e.g. a struct to an enum.
|
||||
MismatchedKinds {
|
||||
from_kind: ReflectKind,
|
||||
to_kind: ReflectKind,
|
||||
|
@ -861,7 +861,7 @@ impl MeshAllocator {
|
||||
}
|
||||
|
||||
impl GeneralSlab {
|
||||
/// Creates a new growable slab big enough to hold an single element of
|
||||
/// Creates a new growable slab big enough to hold a single element of
|
||||
/// `data_slot_count` size with the given `layout`.
|
||||
fn new(
|
||||
new_slab_id: SlabId,
|
||||
|
@ -1202,7 +1202,7 @@ pub trait SortedPhaseItem: PhaseItem {
|
||||
/// Sorts a slice of phase items into render order. Generally if the same type
|
||||
/// is batched this should use a stable sort like [`slice::sort_by_key`].
|
||||
/// In almost all other cases, this should not be altered from the default,
|
||||
/// which uses a unstable sort, as this provides the best balance of CPU and GPU
|
||||
/// which uses an unstable sort, as this provides the best balance of CPU and GPU
|
||||
/// performance.
|
||||
///
|
||||
/// Implementers can optionally not sort the list at all. This is generally advisable if and
|
||||
|
@ -26,7 +26,7 @@ use wgpu::{
|
||||
|
||||
/// A descriptor for a [`Pipeline`].
|
||||
///
|
||||
/// Used to store an heterogenous collection of render and compute pipeline descriptors together.
|
||||
/// Used to store a heterogenous collection of render and compute pipeline descriptors together.
|
||||
#[derive(Debug)]
|
||||
pub enum PipelineDescriptor {
|
||||
RenderPipelineDescriptor(Box<RenderPipelineDescriptor>),
|
||||
@ -35,7 +35,7 @@ pub enum PipelineDescriptor {
|
||||
|
||||
/// A pipeline defining the data layout and shader logic for a specific GPU task.
|
||||
///
|
||||
/// Used to store an heterogenous collection of render and compute pipelines together.
|
||||
/// Used to store a heterogenous collection of render and compute pipelines together.
|
||||
#[derive(Debug)]
|
||||
pub enum Pipeline {
|
||||
RenderPipeline(RenderPipeline),
|
||||
|
@ -403,7 +403,7 @@ impl SceneSpawner {
|
||||
}
|
||||
}
|
||||
|
||||
/// Check that an scene instance spawned previously is ready to use
|
||||
/// Check that a scene instance spawned previously is ready to use
|
||||
pub fn instance_is_ready(&self, instance_id: InstanceId) -> bool {
|
||||
self.spawned_instances.contains_key(&instance_id)
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ pub struct TextureSlice {
|
||||
}
|
||||
|
||||
impl TextureSlice {
|
||||
/// Transforms the given slice in an collection of tiled subdivisions.
|
||||
/// Transforms the given slice in a collection of tiled subdivisions.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
|
@ -334,7 +334,7 @@ impl TaskPool {
|
||||
T: Send + 'static,
|
||||
{
|
||||
Self::THREAD_EXECUTOR.with(|scope_executor| {
|
||||
// If a `external_executor` is passed use that. Otherwise get the executor stored
|
||||
// If an `external_executor` is passed, use that. Otherwise, get the executor stored
|
||||
// in the `THREAD_EXECUTOR` thread local.
|
||||
if let Some(external_executor) = external_executor {
|
||||
self.scope_with_executor_inner(
|
||||
|
@ -115,7 +115,7 @@ impl<T> SyncUnsafeCell<[T]> {
|
||||
}
|
||||
|
||||
impl<T: Default> Default for SyncUnsafeCell<T> {
|
||||
/// Creates an `SyncUnsafeCell`, with the `Default` value for T.
|
||||
/// Creates a new `SyncUnsafeCell` with the `Default` value for T.
|
||||
fn default() -> SyncUnsafeCell<T> {
|
||||
SyncUnsafeCell::new(Default::default())
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ pub struct CursorLeft {
|
||||
pub window: Entity,
|
||||
}
|
||||
|
||||
/// A Input Method Editor event.
|
||||
/// An Input Method Editor event.
|
||||
///
|
||||
/// This event is the translated version of the `WindowEvent::Ime` from the `winit` crate.
|
||||
///
|
||||
|
@ -265,7 +265,7 @@ Bevy support for WebGPU is being worked on, but is currently experimental.
|
||||
|
||||
To build for WebGPU, you'll need to enable the `webgpu` feature. This will override the `webgl2` feature, and builds with the `webgpu` feature enabled won't be able to run on browsers that don't support WebGPU.
|
||||
|
||||
Bevy has an helper to build its examples:
|
||||
Bevy has a helper to build its examples:
|
||||
|
||||
- Build for WebGL2: `cargo run -p build-wasm-example -- --api webgl2 load_gltf`
|
||||
- Build for WebGPU: `cargo run -p build-wasm-example -- --api webgpu load_gltf`
|
||||
|
@ -137,7 +137,7 @@ You can do this in one line with `nix-shell --run "cargo run"`.
|
||||
If running nix on a non NixOS system (such as ubuntu, arch etc.), [NixGL](https://github.com/nix-community/nixGL) is additionally required,
|
||||
to link graphics drivers into the context of software installed by nix:
|
||||
|
||||
1. Install an system specific nixGL wrapper ([docs](https://github.com/nix-community/nixGL)).
|
||||
1. Install a system specific nixGL wrapper ([docs](https://github.com/nix-community/nixGL)).
|
||||
* If you're running a nvidia GPU choose `nixVulkanNvidia`.
|
||||
* Otherwise, choose another wrapper appropriate for your system.
|
||||
2. Run `nixVulkanNvidia-xxx.xxx.xx cargo run` to compile a bevy program, where `xxx-xxx-xx` denotes the graphics driver version `nixVulkanNvidia` was compiled with.
|
||||
|
@ -742,7 +742,7 @@ Bevy support for WebGPU is being worked on, but is currently experimental.
|
||||
|
||||
To build for WebGPU, you'll need to enable the `webgpu` feature. This will override the `webgl2` feature, and builds with the `webgpu` feature enabled won't be able to run on browsers that don't support WebGPU.
|
||||
|
||||
Bevy has an helper to build its examples:
|
||||
Bevy has a helper to build its examples:
|
||||
|
||||
- Build for WebGL2: `cargo run -p build-wasm-example -- --api webgl2 load_gltf`
|
||||
- Build for WebGPU: `cargo run -p build-wasm-example -- --api webgpu load_gltf`
|
||||
|
@ -134,7 +134,7 @@ fn setup(
|
||||
],
|
||||
)
|
||||
// Tell bevy to construct triangles from a list of vertex indices,
|
||||
// where each 3 vertex indices form an triangle.
|
||||
// where each 3 vertex indices form a triangle.
|
||||
.with_inserted_indices(Indices::U16(vec![
|
||||
0, 1, 3, 0, 3, 2, 2, 3, 5, 2, 5, 4, 4, 5, 7, 4, 7, 6, 6, 7, 9, 6, 9, 8,
|
||||
]));
|
||||
|
@ -69,7 +69,7 @@ fn data_pipe_system(message: Res<Message>) -> String {
|
||||
message.0.clone()
|
||||
}
|
||||
|
||||
// This system produces an Result<String> output by trying to extract a String from the
|
||||
// This system produces a Result<String> output by trying to extract a String from the
|
||||
// OptionalWarning resource. Try changing the OptionalWarning resource to None. You should
|
||||
// not see the warning message printed.
|
||||
fn warning_pipe_system(message: Res<OptionalWarning>) -> Result<(), String> {
|
||||
|
@ -65,7 +65,7 @@ const FOCUSED_BORDER: Srgba = bevy::color::palettes::tailwind::BLUE_50;
|
||||
// In a real project, each button would also have its own unique behavior,
|
||||
// to capture the actual intent of the user
|
||||
fn universal_button_click_behavior(
|
||||
// We're using a on-mouse-down trigger to improve responsiveness;
|
||||
// We're using an on-mouse-down trigger to improve responsiveness;
|
||||
// Clicked is better when you want roll-off cancellation
|
||||
mut trigger: Trigger<Pointer<Pressed>>,
|
||||
mut button_query: Query<(&mut BackgroundColor, &mut ResetTimer)>,
|
||||
|
@ -3,7 +3,7 @@
|
||||
//!
|
||||
//! When window decorations are not present, the user cannot drag a window by
|
||||
//! its titlebar to change its position. The `start_drag_move()` function
|
||||
//! permits a users to drag a window by left clicking anywhere in the window;
|
||||
//! permits a user to drag a window by left clicking anywhere in the window;
|
||||
//! left click must be pressed and other constraints can be imposed. For
|
||||
//! instance an application could require a user to hold down alt and left click
|
||||
//! to drag a window.
|
||||
|
Loading…
Reference in New Issue
Block a user