summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-11-05 12:18:22 +0100
committerHampusM <hampus@hampusmat.com>2026-11-05 12:18:22 +0100
commit60c8ce6b9b2f1abd107545027bf65075234a5538 (patch)
tree23de2db0e026747b87ad45c1c965863d28e52c1c /engine
parentc0898600fd5f0db11b02056fa3dc14414aee47e5 (diff)
refactor(engine): use either crate instead of engine_ecs::util::Either
Diffstat (limited to 'engine')
-rw-r--r--engine/Cargo.toml1
-rw-r--r--engine/src/file_format/wavefront/obj.rs6
-rw-r--r--engine/src/ui/view/world.rs6
3 files changed, 7 insertions, 6 deletions
diff --git a/engine/Cargo.toml b/engine/Cargo.toml
index 62a526d..68bf69d 100644
--- a/engine/Cargo.toml
+++ b/engine/Cargo.toml
@@ -19,6 +19,7 @@ intmap = "3.1.3"
hashbrown = "0.15.2"
rayon = "1.12.0"
safer_owning_ref = "=0.5.1"
+either = "1.19.0"
engine-macros = { workspace = true }
engine-ecs = { workspace = true }
engine-reflection = { workspace = true }
diff --git a/engine/src/file_format/wavefront/obj.rs b/engine/src/file_format/wavefront/obj.rs
index d1a1bf3..7210465 100644
--- a/engine/src/file_format/wavefront/obj.rs
+++ b/engine/src/file_format/wavefront/obj.rs
@@ -6,7 +6,7 @@ use std::collections::HashMap;
use std::fs::read_to_string;
use std::path::PathBuf;
-use engine_ecs::util::Either;
+use either::Either;
use crate::file_format::wavefront::common::{
keyword,
@@ -234,8 +234,8 @@ impl Obj
)?)?)
})
.flat_map(|res| match res {
- Ok(inner) => Either::A(inner.into_iter().map(Ok)),
- Err(err) => Either::B(vec![Err(err)].into_iter()),
+ Ok(inner) => Either::Left(inner.into_iter().map(Ok)),
+ Err(err) => Either::Right(vec![Err(err)].into_iter()),
})
.collect::<Result<Vec<_>, _>>()
}
diff --git a/engine/src/ui/view/world.rs b/engine/src/ui/view/world.rs
index bf92859..5667963 100644
--- a/engine/src/ui/view/world.rs
+++ b/engine/src/ui/view/world.rs
@@ -8,6 +8,7 @@ use ecs::phase::Phase;
use ecs::query::term::{With, Without};
use ecs::sole::Is as IsSole;
use ecs::system::Function as SystemFunction;
+use either::Either;
use crate::color::{Rgb, Rgba};
use crate::ecs::actions::Actions;
@@ -16,7 +17,6 @@ use crate::ecs::component::{Info as ComponentInfo, Parts as ComponentParts};
use crate::ecs::entity::{Handle as EntityHandle, Name as EntityName};
use crate::ecs::sole::Single;
use crate::ecs::uid::Uid;
-use crate::ecs::util::Either;
use crate::ecs::{Component, Query, World};
use crate::image::{Format as ImageFormat, Image};
use crate::reflection::{
@@ -1819,8 +1819,8 @@ fn create_enum_widgets(
let disabled = variant.fields.as_ref().and_then(|fields| {
fields.fields().iter().find_map(|field| {
let field_name = match field.name {
- Some(field_name) => Either::A(field_name),
- None => Either::B(field.index),
+ Some(field_name) => Either::Left(field_name),
+ None => Either::Right(field.index),
};
let Some(field_type) = field.type_reflection() else {