Skip to content

Commit

Permalink
Merge pull request #10 from rnestler/use-rust2018
Browse files Browse the repository at this point in the history
Use Rust 2018 Edition
  • Loading branch information
dbrgn authored Aug 17, 2020
2 parents 753bfcc + 2ea9ce3 commit 634f9eb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: rust:1.31.1
- image: rust:1.32.0
steps:
- checkout

Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ include = [
"LICENSE-MIT",
"LICENSE-APACHE",
]
edition = "2018"

[features]
default = []
Expand Down
4 changes: 0 additions & 4 deletions examples/linux.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
extern crate embedded_hal;
extern crate linux_embedded_hal;
extern crate sgp30;

use embedded_hal::blocking::delay::DelayMs;
use linux_embedded_hal::{I2cdev, Delay};
use sgp30::Sgp30;
Expand Down
31 changes: 11 additions & 20 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
//! the device:
//!
//! ```no_run
//! extern crate linux_embedded_hal as hal;
//! extern crate sgp30;
//! use linux_embedded_hal as hal;
//!
//! use hal::{Delay, I2cdev};
//! use sgp30::Sgp30;
Expand All @@ -37,8 +36,7 @@
//! set](struct.FeatureSet.html):
//!
//! ```no_run
//! # extern crate linux_embedded_hal as hal;
//! # extern crate sgp30;
//! # use linux_embedded_hal as hal;
//! # use hal::{Delay, I2cdev};
//! # use sgp30::Sgp30;
//! use sgp30::FeatureSet;
Expand All @@ -56,8 +54,7 @@
//! Before you do any measurements, you need to initialize the sensor.
//!
//! ```no_run
//! # extern crate linux_embedded_hal as hal;
//! # extern crate sgp30;
//! # use linux_embedded_hal as hal;
//! # use hal::{Delay, I2cdev};
//! # use sgp30::Sgp30;
//! # fn main() {
Expand All @@ -76,9 +73,7 @@
//! this driver to ensure that these periodic measurements are being done!
//!
//! ```no_run
//! # extern crate embedded_hal;
//! # extern crate linux_embedded_hal as hal;
//! # extern crate sgp30;
//! # use linux_embedded_hal as hal;
//! # use hal::I2cdev;
//! # use sgp30::Sgp30;
//! use embedded_hal::blocking::delay::DelayMs;
Expand Down Expand Up @@ -123,8 +118,7 @@
//! followed by [`set_baseline()`](struct.Sgp30.html#method.set_baseline).
//!
//! ```no_run
//! # extern crate linux_embedded_hal as hal;
//! # extern crate sgp30;
//! # use linux_embedded_hal as hal;
//! # use hal::{I2cdev, Delay};
//! # use sgp30::Sgp30;
//! use sgp30::Baseline;
Expand All @@ -148,8 +142,7 @@
//! external humidity sensor is required.
//!
//! ```no_run
//! # extern crate linux_embedded_hal as hal;
//! # extern crate sgp30;
//! # use linux_embedded_hal as hal;
//! # use hal::{I2cdev, Delay};
//! # use sgp30::Sgp30;
//! use sgp30::Humidity;
Expand All @@ -176,17 +169,15 @@
#![deny(missing_docs)]
#![cfg_attr(not(test), no_std)]

extern crate byteorder;
extern crate embedded_hal as hal;
extern crate num_traits;
use embedded_hal as hal;

use byteorder::{BigEndian, ByteOrder};
use hal::blocking::delay::{DelayMs, DelayUs};
use hal::blocking::i2c::{Read, Write, WriteRead};
use crate::hal::blocking::delay::{DelayMs, DelayUs};
use crate::hal::blocking::i2c::{Read, Write, WriteRead};

mod types;

pub use types::{Measurement, RawSignals, Baseline, Humidity, FeatureSet, ProductType};
pub use crate::types::{Measurement, RawSignals, Baseline, Humidity, FeatureSet, ProductType};


const CRC8_POLYNOMIAL: u8 = 0x31;
Expand Down Expand Up @@ -630,7 +621,7 @@ fn crc8(data: &[u8]) -> u8 {

#[cfg(test)]
mod tests {
extern crate embedded_hal_mock as hal;
use embedded_hal_mock as hal;

use super::*;
use self::hal::delay::MockNoop as DelayMock;
Expand Down

0 comments on commit 634f9eb

Please sign in to comment.