mirror of
https://github.com/G2-Games/cross-usb.git
synced 2025-04-19 13:22:53 -05:00
Compare commits
2 commits
782cbfa7f5
...
71fafc0b0d
Author | SHA1 | Date | |
---|---|---|---|
71fafc0b0d | |||
9505ef0204 |
3 changed files with 11 additions and 7 deletions
|
@ -3,5 +3,5 @@ rustflags = ["--cfg=web_sys_unstable_apis"]
|
|||
|
||||
[build]
|
||||
#just comment in the "current" target
|
||||
target = "x86_64-unknown-linux-gnu"
|
||||
#target = "wasm32-unknown-unknown"
|
||||
#target = "x86_64-unknown-linux-gnu"
|
||||
target = "wasm32-unknown-unknown"
|
||||
|
|
|
@ -11,16 +11,16 @@ keywords = ["usb", "wasm", "web-usb", "webusb"]
|
|||
categories = ["wasm", "web-programming", "hardware-support"]
|
||||
readme = "README.md"
|
||||
license = "MIT"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
thiserror = "1.0"
|
||||
thiserror = "2.0"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio-test = "0.4.3"
|
||||
tokio-test = "0.4"
|
||||
|
||||
# Wasm deps
|
||||
[target.'cfg(target_family = "wasm")'.dependencies]
|
||||
|
|
|
@ -410,7 +410,9 @@ impl<'a> UsbInterface<'a> for Interface {
|
|||
let result: UsbOutTransferResult = match JsFuture::from(Promise::resolve(
|
||||
&self
|
||||
.device
|
||||
.control_transfer_out_with_buffer_source(¶ms, array_obj),
|
||||
.control_transfer_out_with_buffer_source(¶ms, array_obj)
|
||||
.map_err(|j| Error::CommunicationError(j.as_string().unwrap_or_default()))?
|
||||
.into(),
|
||||
))
|
||||
.await
|
||||
{
|
||||
|
@ -448,7 +450,9 @@ impl<'a> UsbInterface<'a> for Interface {
|
|||
let promise = Promise::resolve(
|
||||
&self
|
||||
.device
|
||||
.transfer_out_with_buffer_source(endpoint, array_obj),
|
||||
.transfer_out_with_buffer_source(endpoint, array_obj)
|
||||
.map_err(|j| Error::CommunicationError(j.as_string().unwrap_or_default()))?
|
||||
.into(),
|
||||
);
|
||||
|
||||
let result = JsFuture::from(promise).await;
|
||||
|
|
Loading…
Reference in a new issue