style: fix clippy error

This commit is contained in:
LongYinan 2021-03-31 11:53:51 +08:00
parent 81af1674a8
commit 925786c955
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -6,9 +6,9 @@ pub enum Either<A: NapiValue, B: NapiValue> {
B(B),
}
impl<T: NapiValue> Into<Option<T>> for Either<T, JsUndefined> {
fn into(self) -> Option<T> {
match self {
impl<T: NapiValue> From<Either<T, JsUndefined>> for Option<T> {
fn from(value: Either<T, JsUndefined>) -> Option<T> {
match value {
Either::A(v) => Some(v),
Either::B(_) => None,
}