juliangaal / mpu6050

MPU6050 embedded-hal driver written in Rust
https://crates.io/crates/mpu6050
MIT License
52 stars 31 forks source link

Fix _unresolved type `Error`_ in example code #6

Closed theastrallyforged closed 5 years ago

theastrallyforged commented 5 years ago
error[E0433]: failed to resolve: use of undeclared type or module `Error`
 --> src/main.rs:7:18
  |
7 |         .map_err(Error::I2c)?;
  |                  ^^^^^ use of undeclared type or module `Error`

error[E0412]: cannot find type `Error` in this scope
 --> src/main.rs:5:25
  |
5 | fn main() -> Result<(), Error<LinuxI2CError>> {
  |                         ^^^^^ not found in this scope
juliangaal commented 5 years ago

Not sure which branch/rev you are on, but this is not an issue on the current master branch ;)

theastrallyforged commented 5 years ago

You're right, in that cargo test passes on master.

However, if you copy the example code from README.md into the crate-level doc comment, cargo test stops passing. ;)

juliangaal commented 5 years ago

Oh I see, it's in the README. Thanks for the heads up!

Are you using the driver right now? How is your experience?

theastrallyforged commented 5 years ago

I'm not, but there was somecreature in Mozilla/#rust-beginners a week or so ago who was new to the language and got pretty confused when the example code didn't compile, so I thought I'd fix it right quick. :)

juliangaal commented 5 years ago

ah, great to hear. Have a good weekend