diff options
| author | Yuval Adam <_@yuv.al> | 2018-07-23 11:24:36 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2018-07-23 11:24:36 +0300 |
| commit | b4975f7e0c42b60350a0b5b98c5e3f8302427cf0 (patch) | |
| tree | e1babf2283adaf69b313cc3a97ab76d1514fce71 | |
| parent | 1ec4d661a0dccc84bee5585570259be02c6004bf (diff) | |
Add basic Dongle struct
| -rw-r--r-- | Cargo.toml | 1 | ||||
| -rw-r--r-- | src/lib.rs | 17 |
2 files changed, 16 insertions, 2 deletions
@@ -4,3 +4,4 @@ version = "0.1.0" authors = ["Yuval Adam <_@yuv.al>"] [dependencies] +libusb = "0.3" @@ -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"); } } |
