Skip to content

Instantly share code, notes, and snippets.

@awelkie awelkie/Cargo.toml
Created Dec 20, 2015

Embed
What would you like to do?
PhantomRef
[package]
name = "usb_example"
version = "0.1.0"
authors = ["Allen Welkie <allen.welkie@gmail.com>"]
[dependencies]
libusb = "*"
extern crate libusb;
struct Combined<'a> {
ctx: libusb::Context,
dev: libusb::Device<'a>,
}
fn get_device<'a>() -> Combined<'a> {
let mut ctx = libusb::Context::new().unwrap();
let dev = ctx.devices().unwrap().iter().next().unwrap();
Combined { ctx: ctx, dev: dev, }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.