chore(napi): add u64 to BigInt conversion through From trait (#1143)

* Add u64 to BigInt conversion through From trait

* Fix lint
This commit is contained in:
Gabriel Francisco 2022-04-22 13:29:18 -03:00 committed by GitHub
parent 454d3b8cab
commit 581e3bbb87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -208,3 +208,12 @@ impl ToNapiValue for isize {
Ok(raw_value)
}
}
impl From<u64> for BigInt {
fn from(val: u64) -> Self {
BigInt {
sign_bit: false,
words: vec![val],
}
}
}