diff --git a/crates/napi/src/bindgen_runtime/js_values/either.rs b/crates/napi/src/bindgen_runtime/js_values/either.rs
index a8bfe3f8..aab142b6 100644
--- a/crates/napi/src/bindgen_runtime/js_values/either.rs
+++ b/crates/napi/src/bindgen_runtime/js_values/either.rs
@@ -1,22 +1,18 @@
use super::{FromNapiValue, ToNapiValue, TypeName};
-use crate::{sys, type_of, JsNull, JsUndefined, NapiRaw, Status, ValueType};
+use crate::{
+ bindgen_runtime::{Null, Undefined},
+ sys, type_of, JsUndefined, NapiRaw, Status, ValueType,
+};
const ERROR_MSG: &str = "The return value of typeof(T) should not be equal in Either";
#[derive(Debug, Clone, Copy)]
-pub enum Either<
- A: TypeName + FromNapiValue + ToNapiValue,
- B: TypeName + FromNapiValue + ToNapiValue,
-> {
+pub enum Either {
A(A),
B(B),
}
-impl<
- A: TypeName + FromNapiValue + ToNapiValue + NapiRaw,
- B: TypeName + FromNapiValue + ToNapiValue + NapiRaw,
- > Either
-{
+impl Either {
/// # Safety
/// Backward compatible with `Either` in **v1**
pub unsafe fn raw(&self) -> sys::napi_value {
@@ -27,9 +23,7 @@ impl<
}
}
-impl TypeName
- for Either
-{
+impl TypeName for Either {
fn type_name() -> &'static str {
"Either"
}
@@ -40,7 +34,7 @@ impl From> for Option {
+impl From> for Option {
fn from(value: Either) -> Option {
match value {
Either::A(v) => Some(v),
@@ -49,8 +43,17 @@ impl From> for
}
}
-impl From> for Option {
- fn from(value: Either) -> Option {
+impl From