From 02afe68342870ce4f37d7e8fb45c985397d6e08d Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 23 May 2026 19:46:46 +0200 Subject: refactor(engine): use Rust edition 2021 This change is because of a rustfmt bug in the 2024 edition. For example, the following code snippet: ``` struct Value {} struct ParsingError {} trait Keyword {} impl Value { fn parse(value: &str, line_no: usize) -> Result { todo!(); } } ``` when formatted with `rustfmt --edition 2021 --emit stdout --config max_width=90,brace_style=AlwaysNextLine` becomes: ``` struct Value {} struct ParsingError {} trait Keyword {} impl Value { fn parse(value: &str, line_no: usize) -> Result { todo!(); } } ``` --- engine/src/shader.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'engine/src/shader.rs') diff --git a/engine/src/shader.rs b/engine/src/shader.rs index d5611ca..7988724 100644 --- a/engine/src/shader.rs +++ b/engine/src/shader.rs @@ -6,10 +6,6 @@ use std::path::Path; use std::str::Utf8Error; use bitflags::{bitflags, bitflags_match}; -use crate::ecs::pair::{ChildOf, Pair}; -use crate::ecs::phase::{POST_UPDATE as POST_UPDATE_PHASE, Phase, START as START_PHASE}; -use crate::ecs::sole::Single; -use crate::ecs::{Component, Sole, declare_entity}; use shader_slang::{ Blob as SlangBlob, ComponentType as SlangComponentType, @@ -32,6 +28,10 @@ use crate::asset::{ Submitter as AssetSubmitter, }; use crate::builder; +use crate::ecs::pair::{ChildOf, Pair}; +use crate::ecs::phase::{POST_UPDATE as POST_UPDATE_PHASE, Phase, START as START_PHASE}; +use crate::ecs::sole::Single; +use crate::ecs::{Component, Sole, declare_entity}; use crate::shader::default::{ ASSET_LABEL, enqueue_set_shader_bindings as default_shader_enqueue_set_shader_bindings, @@ -77,7 +77,7 @@ pub struct Module impl Module { - pub fn entry_points(&self) -> impl ExactSizeIterator + pub fn entry_points(&self) -> impl ExactSizeIterator + use<'_> { self.inner .entry_points() @@ -218,8 +218,9 @@ impl<'a> ProgramReflection<'a> }) } - pub fn entry_points(&self) - -> impl ExactSizeIterator> + pub fn entry_points( + &self, + ) -> impl ExactSizeIterator> + use<'a> { self.inner .entry_points() -- cgit v1.2.3-18-g5258