diff options
| author | HampusM <hampus@hampusmat.com> | 2026-05-23 19:46:46 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-05-23 19:52:55 +0200 |
| commit | 02afe68342870ce4f37d7e8fb45c985397d6e08d (patch) | |
| tree | a3a83450ea11ed9b6131aac5aca587418f20e708 /engine/src/shader.rs | |
| parent | aa83c5cbc21227a5c647063efcaaca178884da9f (diff) | |
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<KeywordT: Keyword>(value: &str, line_no: usize) -> Result<Self, ParsingError> {
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<KeywordT: Keyword>(value: &str, line_no: usize)
-> Result<Self, ParsingError>
{
todo!();
}
}
```
Diffstat (limited to 'engine/src/shader.rs')
| -rw-r--r-- | engine/src/shader.rs | 15 |
1 files changed, 8 insertions, 7 deletions
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<Item = EntryPoint> + pub fn entry_points(&self) -> impl ExactSizeIterator<Item = EntryPoint> + use<'_> { self.inner .entry_points() @@ -218,8 +218,9 @@ impl<'a> ProgramReflection<'a> }) } - pub fn entry_points(&self) - -> impl ExactSizeIterator<Item = EntryPointReflection<'a>> + pub fn entry_points( + &self, + ) -> impl ExactSizeIterator<Item = EntryPointReflection<'a>> + use<'a> { self.inner .entry_points() |
