Skip to content

Commit

Permalink
Expose DfuASync/DfuSync as type alias for more ergonomic usage
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoerdsimons committed Nov 1, 2024
1 parent 19ab11b commit 46c3ab6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use dfu_core::{
use nusb::transfer::{Control, ControlIn, ControlOut, ControlType, Recipient, TransferError};
use thiserror::Error;

pub use dfu_core::asynchronous::DfuASync;
pub use dfu_core::sync::DfuSync;
pub type DfuASync = dfu_core::asynchronous::DfuASync<DfuNusb, Error>;
pub type DfuSync = dfu_core::sync::DfuSync<DfuNusb, Error>;

#[derive(Debug, Error)]
pub enum Error {
Expand Down Expand Up @@ -72,12 +72,12 @@ impl DfuNusb {
}

/// Wrap device in an *async* dfu helper
pub fn into_async_dfu(self) -> DfuASync<Self, Error> {
pub fn into_async_dfu(self) -> DfuASync {
DfuASync::new(self)
}

/// Wrap device in an *sync* dfu helper
pub fn into_sync_dfu(self) -> DfuSync<Self, Error> {
pub fn into_sync_dfu(self) -> DfuSync {
DfuSync::new(self)
}
}
Expand Down

0 comments on commit 46c3ab6

Please sign in to comment.