Merge pull request #520 from napi-rs/fix-clippy

style: fix clippy error
This commit is contained in:
LongYinan 2021-03-31 16:35:10 +08:00 committed by GitHub
commit 3e239f69b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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