Edition 2018 (#24)

* "cargo fix --edition" for the library

* Switch to 2018 edition

* Use cargo fix edition-idioms and remove the internal renaming from embedded_hal to hal

* Updated Readme

* run cargo fmt
This commit is contained in:
Chris
2019-02-22 11:23:28 +01:00
committed by GitHub
parent 91b723d30e
commit d7f3cdca97
15 changed files with 49 additions and 50 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
//! SPI Commands for the Waveshare 4.2" E-Ink Display
use traits;
use crate::traits;
/// EPD4IN2 commands
///
/// Should rarely (never?) be needed directly.
@@ -165,7 +165,7 @@ impl traits::Command for Command {
#[cfg(test)]
mod tests {
use super::*;
use traits::Command as CommandTrait;
use crate::traits::Command as CommandTrait;
#[test]
fn command_addr() {
+1 -1
View File
@@ -1,4 +1,4 @@
use color::Color;
use crate::color::Color;
pub const WIDTH: u32 = 400;
pub const HEIGHT: u32 = 300;
+5 -5
View File
@@ -1,4 +1,4 @@
use epd4in2::constants::{DEFAULT_BACKGROUND_COLOR, HEIGHT, WIDTH};
use crate::epd4in2::constants::{DEFAULT_BACKGROUND_COLOR, HEIGHT, WIDTH};
/// Full size buffer for use with the 4in2 EPD
///
@@ -20,12 +20,12 @@ impl Default for Buffer4in2 {
#[cfg(test)]
mod tests {
use super::*;
use color::Color;
use crate::color::Color;
use crate::epd4in2;
use crate::graphics::{Display, DisplayRotation};
use embedded_graphics::coord::Coord;
use embedded_graphics::prelude::*;
use embedded_graphics::primitives::Line;
use epd4in2;
use graphics::{Display, DisplayRotation};
// test buffer length
#[test]
@@ -40,7 +40,7 @@ mod tests {
fn graphics_default() {
let mut display4in2 = Buffer4in2::default();
let display = Display::new(WIDTH, HEIGHT, &mut display4in2.buffer);
use epd4in2;
use crate::epd4in2;
for &byte in display.buffer() {
assert_eq!(
byte,
+4 -4
View File
@@ -46,19 +46,19 @@
//!
//! BE CAREFUL! The screen can get ghosting/burn-ins through the Partial Fast Update Drawing.
use hal::{
use embedded_hal::{
blocking::{delay::*, spi::Write},
digital::*,
};
use interface::DisplayInterface;
use traits::{InternalWiAdditions, RefreshLUT, WaveshareDisplay};
use crate::interface::DisplayInterface;
use crate::traits::{InternalWiAdditions, RefreshLUT, WaveshareDisplay};
//The Lookup Tables for the Display
mod constants;
pub use self::constants::*;
use color::Color;
use crate::color::Color;
pub(crate) mod command;
use self::command::Command;