From c3ff6d413634578eee0c8e8135b8baf6bd735406 Mon Sep 17 00:00:00 2001 From: Benjamin Brienen Date: Tue, 11 Mar 2025 07:17:48 +0100 Subject: [PATCH] Fix non-crate typos (#18219) # Objective Correct spelling ## Solution Fix typos, specifically ones that I found in folders other than /crates ## Testing CI --------- Co-authored-by: Alice Cecile --- Cargo.toml | 2 +- assets/shaders/specialized_mesh_pipeline.wgsl | 4 ++-- assets/shaders/tonemapping_test_patterns.wgsl | 8 ++++---- benches/benches/bevy_ecs/scheduling/schedule.rs | 2 +- examples/README.md | 2 +- examples/games/alien_cake_addict.rs | 4 ++-- examples/games/stepping.rs | 2 +- examples/math/custom_primitives.rs | 10 +++++----- examples/ui/scroll.rs | 2 +- examples/ui/text_debug.rs | 4 ++-- examples/ui/viewport_debug.rs | 4 ++-- examples/ui/window_fallthrough.rs | 2 +- examples/window/low_power.rs | 2 +- tests/window/change_window_mode.rs | 2 +- tools/compile_fail_utils/tests/example.rs | 2 +- 15 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e9e593b607..e37832e3b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1835,7 +1835,7 @@ path = "examples/asset/multi_asset_sync.rs" doc-scrape-examples = true [package.metadata.example.multi_asset_sync] -name = "Mult-asset synchronization" +name = "Multi-asset synchronization" description = "Demonstrates how to wait for multiple assets to be loaded." category = "Assets" wasm = true diff --git a/assets/shaders/specialized_mesh_pipeline.wgsl b/assets/shaders/specialized_mesh_pipeline.wgsl index e307a7c48c..29c9069ec8 100644 --- a/assets/shaders/specialized_mesh_pipeline.wgsl +++ b/assets/shaders/specialized_mesh_pipeline.wgsl @@ -2,7 +2,7 @@ //! between the vertex and fragment shader. Also shows the custom vertex layout. // First we import everything we need from bevy_pbr -// A 2d shader would be vevry similar but import from bevy_sprite instead +// A 2D shader would be very similar but import from bevy_sprite instead #import bevy_pbr::{ mesh_functions, view_transformations::position_world_to_clip @@ -45,4 +45,4 @@ fn vertex(vertex: Vertex) -> VertexOutput { fn fragment(in: VertexOutput) -> @location(0) vec4 { // output the color directly return vec4(in.color, 1.0); -} \ No newline at end of file +} diff --git a/assets/shaders/tonemapping_test_patterns.wgsl b/assets/shaders/tonemapping_test_patterns.wgsl index 7fe88bf548..2237bdf6c5 100644 --- a/assets/shaders/tonemapping_test_patterns.wgsl +++ b/assets/shaders/tonemapping_test_patterns.wgsl @@ -9,19 +9,19 @@ #import bevy_core_pipeline::tonemapping::tone_mapping #endif -// Sweep across hues on y axis with value from 0.0 to +15EV across x axis +// Sweep across hues on y axis with value from 0.0 to +15EV across x axis // quantized into 24 steps for both axis. fn color_sweep(uv_input: vec2) -> vec3 { var uv = uv_input; let steps = 24.0; uv.y = uv.y * (1.0 + 1.0 / steps); let ratio = 2.0; - + let h = PI * 2.0 * floor(1.0 + steps * uv.y) / steps; let L = floor(uv.x * steps * ratio) / (steps * ratio) - 0.5; - + var color = vec3(0.0); - if uv.y < 1.0 { + if uv.y < 1.0 { color = cos(h + vec3(0.0, 1.0, 2.0) * PI * 2.0 / 3.0); let maxRGB = max(color.r, max(color.g, color.b)); let minRGB = min(color.r, min(color.g, color.b)); diff --git a/benches/benches/bevy_ecs/scheduling/schedule.rs b/benches/benches/bevy_ecs/scheduling/schedule.rs index 0450428535..9844461d39 100644 --- a/benches/benches/bevy_ecs/scheduling/schedule.rs +++ b/benches/benches/bevy_ecs/scheduling/schedule.rs @@ -79,7 +79,7 @@ pub fn build_schedule(criterion: &mut Criterion) { // Benchmark graphs of different sizes. for graph_size in [100, 500, 1000] { // Basic benchmark without constraints. - group.bench_function(format!("{graph_size}_schedule_noconstraints"), |bencher| { + group.bench_function(format!("{graph_size}_schedule_no_constraints"), |bencher| { bencher.iter(|| { let mut app = App::new(); for _ in 0..graph_size { diff --git a/examples/README.md b/examples/README.md index 1cf4d14070..1d18be05ce 100644 --- a/examples/README.md +++ b/examples/README.md @@ -251,7 +251,7 @@ Example | Description [Embedded Asset](../examples/asset/embedded_asset.rs) | Embed an asset in the application binary and load it [Extra asset source](../examples/asset/extra_source.rs) | Load an asset from a non-standard asset source [Hot Reloading of Assets](../examples/asset/hot_asset_reloading.rs) | Demonstrates automatic reloading of assets when modified on disk -[Mult-asset synchronization](../examples/asset/multi_asset_sync.rs) | Demonstrates how to wait for multiple assets to be loaded. +[Multi-asset synchronization](../examples/asset/multi_asset_sync.rs) | Demonstrates how to wait for multiple assets to be loaded. [Repeated texture configuration](../examples/asset/repeated_texture.rs) | How to configure the texture to repeat instead of the default clamp to edges ## Async Tasks diff --git a/examples/games/alien_cake_addict.rs b/examples/games/alien_cake_addict.rs index 06a2b9891d..64059f38e8 100644 --- a/examples/games/alien_cake_addict.rs +++ b/examples/games/alien_cake_addict.rs @@ -42,7 +42,7 @@ fn main() { .add_systems(OnEnter(GameState::GameOver), display_score) .add_systems( Update, - gameover_keyboard.run_if(in_state(GameState::GameOver)), + game_over_keyboard.run_if(in_state(GameState::GameOver)), ) .run(); } @@ -378,7 +378,7 @@ fn scoreboard_system(game: Res, mut display: Single<&mut Text>) { } // restart the game when pressing spacebar -fn gameover_keyboard( +fn game_over_keyboard( mut next_state: ResMut>, keyboard_input: Res>, ) { diff --git a/examples/games/stepping.rs b/examples/games/stepping.rs index 543188d4eb..142f44343e 100644 --- a/examples/games/stepping.rs +++ b/examples/games/stepping.rs @@ -72,7 +72,7 @@ impl Plugin for SteppingPlugin { /// Struct for maintaining stepping state #[derive(Resource, Debug)] struct State { - // vector of schedule/nodeid -> text index offset + // vector of schedule/node id -> text index offset systems: Vec<(InternedScheduleLabel, NodeId, usize)>, // ui positioning diff --git a/examples/math/custom_primitives.rs b/examples/math/custom_primitives.rs index a072b44764..cf6d0d5aaf 100644 --- a/examples/math/custom_primitives.rs +++ b/examples/math/custom_primitives.rs @@ -121,7 +121,7 @@ fn setup( // Spawn the 2D heart commands.spawn(( - // We can use the methods defined on the meshbuilder to customize the mesh. + // We can use the methods defined on the `MeshBuilder` to customize the mesh. Mesh3d(meshes.add(HEART.mesh().resolution(50))), MeshMaterial3d(materials.add(StandardMaterial { emissive: RED.into(), @@ -134,7 +134,7 @@ fn setup( // Spawn an extrusion of the heart. commands.spawn(( - // We can set a custom resolution for the round parts of the extrusion aswell. + // We can set a custom resolution for the round parts of the extrusion as well. Mesh3d(meshes.add(EXTRUSION.mesh().resolution(50))), MeshMaterial3d(materials.add(StandardMaterial { base_color: RED.into(), @@ -358,7 +358,7 @@ impl BoundedExtrusion for Heart {} // You can use the `Meshable` trait to create a `MeshBuilder` for the primitive. impl Meshable for Heart { - // The meshbuilder can be used to create the actual mesh for that primitive. + // The `MeshBuilder` can be used to create the actual mesh for that primitive. type Output = HeartMeshBuilder; fn mesh(&self) -> Self::Output { @@ -369,7 +369,7 @@ impl Meshable for Heart { } } -// You can include any additional information needed for meshing the primitive in the meshbuilder. +// You can include any additional information needed for meshing the primitive in the `MeshBuilder`. struct HeartMeshBuilder { heart: Heart, // The resolution determines the amount of vertices used for each wing of the heart @@ -377,7 +377,7 @@ struct HeartMeshBuilder { } // This trait is needed so that the configuration methods of the builder of the primitive are also available for the builder for the extrusion. -// If you do not want to support these configuration options for extrusions you can just implement them for your 2D mesh builder. +// If you do not want to support these configuration options for extrusions you can just implement them for your 2D `MeshBuilder`. trait HeartBuilder { /// Set the resolution for each of the wings of the heart. fn resolution(self, resolution: usize) -> Self; diff --git a/examples/ui/scroll.rs b/examples/ui/scroll.rs index d0bcc6af33..5cf44df553 100644 --- a/examples/ui/scroll.rs +++ b/examples/ui/scroll.rs @@ -47,7 +47,7 @@ fn setup(mut commands: Commands, asset_server: Res) { .with_children(|parent| { // header parent.spawn(( - Text::new("Horizontally Scrolling list (Ctrl + Mousewheel)"), + Text::new("Horizontally Scrolling list (Ctrl + MouseWheel)"), TextFont { font: asset_server.load("fonts/FiraSans-Bold.ttf"), font_size: FONT_SIZE, diff --git a/examples/ui/text_debug.rs b/examples/ui/text_debug.rs index b17b50a4e3..10ba7040b7 100644 --- a/examples/ui/text_debug.rs +++ b/examples/ui/text_debug.rs @@ -175,7 +175,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { }, )); p.spawn(( - TextSpan::new(" this text has zero fontsize"), + TextSpan::new(" this text has zero font size"), TextFont { font: font.clone(), font_size: 0.0, @@ -229,7 +229,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { TextColor(BLUE.into()), )); p.spawn(( - TextSpan::new(" this text has negative fontsize"), + TextSpan::new(" this text has negative font size"), TextFont { font: font.clone(), font_size: -42.0, diff --git a/examples/ui/viewport_debug.rs b/examples/ui/viewport_debug.rs index d9126ea2c3..5d0ea92749 100644 --- a/examples/ui/viewport_debug.rs +++ b/examples/ui/viewport_debug.rs @@ -1,8 +1,8 @@ //! A simple example for debugging viewport coordinates //! -//! This example creates two uinode trees, one using viewport coordinates and one using pixel coordinates, +//! This example creates two UI node trees, one using viewport coordinates and one using pixel coordinates, //! and then switches between them once per second using the `Display` style property. -//! If there are no problems both layouts should be identical, except for the color of the margin changing which is used to signal that the displayed uinode tree has changed +//! If there are no problems both layouts should be identical, except for the color of the margin changing which is used to signal that the displayed UI node tree has changed //! (red for viewport, yellow for pixel). use bevy::{color::palettes::css::*, prelude::*}; diff --git a/examples/ui/window_fallthrough.rs b/examples/ui/window_fallthrough.rs index b00cd433da..9c98c46402 100644 --- a/examples/ui/window_fallthrough.rs +++ b/examples/ui/window_fallthrough.rs @@ -43,7 +43,7 @@ fn setup(mut commands: Commands, asset_server: Res) { }, )); } -// A simple system to handle some keyboard input and toggle on/off the hittest. +// A simple system to handle some keyboard input and toggle on/off the hit test. fn toggle_mouse_passthrough( keyboard_input: Res>, mut window: Single<&mut Window>, diff --git a/examples/window/low_power.rs b/examples/window/low_power.rs index b8893f807c..5b44442b1b 100644 --- a/examples/window/low_power.rs +++ b/examples/window/low_power.rs @@ -94,7 +94,7 @@ fn update_winit( // Sending a `WakeUp` event is useful when you want the app to update the next // frame regardless of any user input. This can be used from outside Bevy, see example // `window/custom_user_event.rs` for an example usage from outside. - // Note that in this example the Wakeup winit event will make the app run in the same + // Note that in this example the `WakeUp` winit event will make the app run in the same // way as continuous let _ = event_loop_proxy.send_event(WakeUp); WinitSettings::desktop_app() diff --git a/tests/window/change_window_mode.rs b/tests/window/change_window_mode.rs index dce4c9cbee..bc32025140 100644 --- a/tests/window/change_window_mode.rs +++ b/tests/window/change_window_mode.rs @@ -47,7 +47,7 @@ fn toggle_window_mode(mut qry_window: Query<&mut Window>) { window.mode = match window.mode { WindowMode::Windowed => { - //it takes a while for the window to change from windowed to fullscreen and back + // it takes a while for the window to change from `Windowed` to `Fullscreen` and back std::thread::sleep(std::time::Duration::from_secs(4)); WindowMode::Fullscreen( MonitorSelection::Entity(entity), diff --git a/tools/compile_fail_utils/tests/example.rs b/tools/compile_fail_utils/tests/example.rs index f101e73b20..bcfbae10f1 100644 --- a/tools/compile_fail_utils/tests/example.rs +++ b/tools/compile_fail_utils/tests/example.rs @@ -1,7 +1,7 @@ fn main() -> compile_fail_utils::ui_test::Result<()> { // Run all tests in the tests/example_tests folder. // If we had more tests we could either call this function - // on everysingle one or use test_multiple and past it an array + // on every single one or use test_multiple and past it an array // of paths. // // Don't forget that when running tests the working directory