Created
June 13, 2015 16:40
-
-
Save ZachMassia/bb29c27de859a4cb84a0 to your computer and use it in GitHub Desktop.
Rust E0191
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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