mirror of
https://github.com/G2-Games/cross-usb.git
synced 2025-04-19 21:32:53 -05:00
Compare commits
No commits in common. "71fafc0b0d7ef73dcc7162cd5d93488c1ec39996" and "782cbfa7f5a6b5ac8a8b8273cae44db3b078fe57" have entirely different histories.
71fafc0b0d
...
782cbfa7f5
3 changed files with 7 additions and 11 deletions
|
@ -3,5 +3,5 @@ rustflags = ["--cfg=web_sys_unstable_apis"]
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
#just comment in the "current" target
|
#just comment in the "current" target
|
||||||
#target = "x86_64-unknown-linux-gnu"
|
target = "x86_64-unknown-linux-gnu"
|
||||||
target = "wasm32-unknown-unknown"
|
#target = "wasm32-unknown-unknown"
|
||||||
|
|
|
@ -11,16 +11,16 @@ keywords = ["usb", "wasm", "web-usb", "webusb"]
|
||||||
categories = ["wasm", "web-programming", "hardware-support"]
|
categories = ["wasm", "web-programming", "hardware-support"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
edition = "2024"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib", "rlib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
thiserror = "2.0"
|
thiserror = "1.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio-test = "0.4"
|
tokio-test = "0.4.3"
|
||||||
|
|
||||||
# Wasm deps
|
# Wasm deps
|
||||||
[target.'cfg(target_family = "wasm")'.dependencies]
|
[target.'cfg(target_family = "wasm")'.dependencies]
|
||||||
|
|
|
@ -410,9 +410,7 @@ impl<'a> UsbInterface<'a> for Interface {
|
||||||
let result: UsbOutTransferResult = match JsFuture::from(Promise::resolve(
|
let result: UsbOutTransferResult = match JsFuture::from(Promise::resolve(
|
||||||
&self
|
&self
|
||||||
.device
|
.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
|
.await
|
||||||
{
|
{
|
||||||
|
@ -450,9 +448,7 @@ impl<'a> UsbInterface<'a> for Interface {
|
||||||
let promise = Promise::resolve(
|
let promise = Promise::resolve(
|
||||||
&self
|
&self
|
||||||
.device
|
.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;
|
let result = JsFuture::from(promise).await;
|
||||||
|
|
Loading…
Reference in a new issue