Skip to content

Commit

Permalink
Implemented From trait for DeviceImage
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJebForge committed Mar 22, 2022
1 parent 950db2e commit da6c8ad
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,22 @@ pub enum Error {
}

pub struct DeviceImage {
pub data: Vec<u8>,
data: Vec<u8>,
}

impl DeviceImage {
/// Constructs [DeviceImage] from a byte array
pub fn from_raw(data: Vec<u8>) -> Self {
Self::from(data)
}
}

impl From<Vec<u8>> for DeviceImage {
fn from(data: Vec<u8>) -> Self {
Self {
data
}
}
}

/// Device USB Product Identifiers (PIDs)
Expand Down

0 comments on commit da6c8ad

Please sign in to comment.