Skip to content

Instantly share code, notes, and snippets.

@ZachMassia
Created June 13, 2015 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ZachMassia/bb29c27de859a4cb84a0 to your computer and use it in GitHub Desktop.
Save ZachMassia/bb29c27de859a4cb84a0 to your computer and use it in GitHub Desktop.
Rust E0191
~/D/R/firmata git:master ❯❯❯ cargo build
Compiling firmata v0.1.0 (file:///Users/zach/Development/Rust/firmata)
src/lib.rs:9:15: 9:25 error: the value of the associated type `Settings` (from the trait `serial::SerialPort`) must be specified [E0191]
src/lib.rs:9 port: &'a SerialPort,
^~~~~~~~~~
error: aborting due to previous error
Could not compile `firmata`.
To learn more, run the command again with --verbose.
extern crate serial;
use std::path::Path;
use serial::prelude::*;
struct FirmataBoard<'a> {
port: &'a SerialPort,
port_path: Path,
}
impl<'a> FirmataBoard<'a> {
pub fn connect(path: &Path) -> serial::Result<FirmataBoard<'a>> {
let mut port = try!(serial::open(&path.as_os_str()));
Ok(FirmataBoard {
port: port,
port_path: path,
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment