summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml1
-rw-r--r--src/lib.rs17
2 files changed, 16 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 6bcf779..b75262e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,3 +4,4 @@ version = "0.1.0"
authors = ["Yuval Adam <_@yuv.al>"]
[dependencies]
+libusb = "0.3"
diff --git a/src/lib.rs b/src/lib.rs
index 31e1bb2..40b4b77 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,7 +1,20 @@
+pub struct Dongle {
+ vendor: u16,
+ product: u16,
+ name: &'static str
+}
+
#[cfg(test)]
mod tests {
+ use super::*;
+
#[test]
- fn it_works() {
- assert_eq!(2 + 2, 4);
+ fn dongle() {
+ let _dongle = Dongle {
+ vendor: 0x1234,
+ product: 0x5678,
+ name: "Test"
+ };
+ assert!(_dongle.name == "Test");
}
}