core: Use either crate instead of a custom implementation
This commit is contained in:
parent
bc9aa18d6f
commit
208aae78ee
|
@ -4184,6 +4184,7 @@ dependencies = [
|
|||
"downcast-rs",
|
||||
"egui",
|
||||
"egui_extras",
|
||||
"either",
|
||||
"encoding_rs",
|
||||
"enum-map",
|
||||
"enumset",
|
||||
|
|
|
@ -66,6 +66,7 @@ ttf-parser = "0.20"
|
|||
num-bigint = "0.4"
|
||||
unic-segment = "0.9.0"
|
||||
id3 = "1.13.1"
|
||||
either = "1.10.0"
|
||||
|
||||
[target.'cfg(not(target_family = "wasm"))'.dependencies.futures]
|
||||
version = "0.3.30"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use crate::avm2::script::TranslationUnit;
|
||||
use crate::avm2::{Activation, Error, Namespace};
|
||||
use crate::context::UpdateContext;
|
||||
use crate::either::Either;
|
||||
use crate::string::{AvmString, WStr, WString};
|
||||
use either::Either;
|
||||
use gc_arena::{Collect, Mutation};
|
||||
use std::fmt::Debug;
|
||||
use swf::avm2::types::{Index, Multiname as AbcMultiname};
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
use std::ops::Deref;
|
||||
|
||||
pub enum Either<A, B> {
|
||||
Left(A),
|
||||
Right(B),
|
||||
}
|
||||
|
||||
impl<A, B> Deref for Either<A, B>
|
||||
where
|
||||
A: Deref,
|
||||
B: Deref<Target = A::Target>,
|
||||
{
|
||||
type Target = A::Target;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
match self {
|
||||
Self::Left(a) => a,
|
||||
Self::Right(b) => b,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,7 +29,6 @@ pub mod context;
|
|||
pub mod context_menu;
|
||||
mod drawing;
|
||||
mod ecma_conversions;
|
||||
pub(crate) mod either;
|
||||
pub mod events;
|
||||
pub mod focus_tracker;
|
||||
mod font;
|
||||
|
|
Loading…
Reference in New Issue