summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine-macros/Cargo.toml2
-rw-r--r--engine/Cargo.toml2
-rw-r--r--engine/src/renderer/main_render_pass.rs21
-rw-r--r--engine/src/shader.rs15
-rw-r--r--engine/src/windowing/mouse.rs3
5 files changed, 23 insertions, 20 deletions
diff --git a/engine-macros/Cargo.toml b/engine-macros/Cargo.toml
index 7470567..d7a1275 100644
--- a/engine-macros/Cargo.toml
+++ b/engine-macros/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "engine-macros"
version = "0.1.0"
-edition = "2024"
+edition = "2021"
[lib]
proc-macro = true
diff --git a/engine/Cargo.toml b/engine/Cargo.toml
index 9b91df8..6187bb4 100644
--- a/engine/Cargo.toml
+++ b/engine/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "engine"
version = "0.1.0"
-edition = "2024"
+edition = "2021"
[dependencies]
glutin = "0.32.3"
diff --git a/engine/src/renderer/main_render_pass.rs b/engine/src/renderer/main_render_pass.rs
index abd1022..04050f8 100644
--- a/engine/src/renderer/main_render_pass.rs
+++ b/engine/src/renderer/main_render_pass.rs
@@ -1,9 +1,8 @@
+use crate::asset::Assets;
+use crate::draw_flags::{DrawFlags, NoDraw, PolygonModeConfig};
use crate::ecs::Query;
use crate::ecs::query::term::{With, Without};
use crate::ecs::sole::Single;
-
-use crate::asset::Assets;
-use crate::draw_flags::{DrawFlags, NoDraw, PolygonModeConfig};
use crate::model::{MaterialSearchResult, Model};
use crate::renderer::object::{Id as RendererObjectId, Store as RendererObjectStore};
use crate::renderer::{
@@ -192,9 +191,13 @@ pub fn add_main_render_passes(
));
}
- if let Some(draw_flags) = draw_flags.as_deref()
- && draw_flags.polygon_mode_config != PolygonModeConfig::default()
- {
+ if let Some(draw_flags) = draw_flags.as_deref().and_then(|draw_flags| {
+ if draw_flags.polygon_mode_config != PolygonModeConfig::default() {
+ Some(draw_flags)
+ } else {
+ None
+ }
+ }) {
render_pass
.commands
.push(RendererCommand::UpdateDrawProperties(
@@ -223,9 +226,9 @@ pub fn add_main_render_passes(
RendererDrawMeshOptions::default(),
));
- if let Some(draw_flags) = draw_flags.as_deref()
- && draw_flags.polygon_mode_config != PolygonModeConfig::default()
- {
+ if draw_flags.as_deref().is_some_and(|draw_flags| {
+ draw_flags.polygon_mode_config != PolygonModeConfig::default()
+ }) {
render_pass
.commands
.push(RendererCommand::UpdateDrawProperties(
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()
diff --git a/engine/src/windowing/mouse.rs b/engine/src/windowing/mouse.rs
index 2a3324e..f4969ea 100644
--- a/engine/src/windowing/mouse.rs
+++ b/engine/src/windowing/mouse.rs
@@ -1,7 +1,6 @@
use std::collections::HashMap;
use crate::ecs::Sole;
-
use crate::vector::Vec2;
#[derive(Debug, Default, Clone, Sole)]
@@ -48,7 +47,7 @@ impl Buttons
/// Returns a iterator that yields buttons and their current states. Only buttons with
/// states is included.
- pub fn all_current(&self) -> impl Iterator<Item = (Button, ButtonState)>
+ pub fn all_current(&self) -> impl Iterator<Item = (Button, ButtonState)> + use<'_>
{
self.map
.iter()