Switch the crate to Rust edition '2018'

This commit is contained in:
Dylan McKay 2020-06-20 06:03:43 +12:00
parent d85627612e
commit 0963ff0f7f
10 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,7 @@
[package] [package]
name = "ruduino" name = "ruduino"
version = "0.1.1" version = "0.1.1"
edition = "2018"
authors = [ authors = [
"The AVR-Rust Project Developers", "The AVR-Rust Project Developers",
"Jake Goulding <jake.goulding@gmail.com>", "Jake Goulding <jake.goulding@gmail.com>",

View File

@ -91,8 +91,7 @@ fn generate_cores_mod_rs(mcus: &[Mcu]) -> Result<(), io::Error> {
fn write_core_module(mcu: &Mcu, w: &mut dyn Write) -> Result<(), io::Error> { fn write_core_module(mcu: &Mcu, w: &mut dyn Write) -> Result<(), io::Error> {
writeln!(w, "//! Core for {}.", mcu.device.name)?; writeln!(w, "//! Core for {}.", mcu.device.name)?;
writeln!(w)?; writeln!(w)?;
writeln!(w, "use {{RegisterBits, Register}};")?; writeln!(w, "use crate::{{modules, RegisterBits, Register}};")?;
writeln!(w, "use modules;")?;
writeln!(w)?; writeln!(w)?;
gen::write_registers(mcu, w)?; gen::write_registers(mcu, w)?;

View File

@ -48,7 +48,7 @@ pub fn write_pins(mcu: &Mcu, w: &mut dyn Write) -> Result<(), io::Error> {
if let Some(port) = mcu.peripheral("PORT") { if let Some(port) = mcu.peripheral("PORT") {
writeln!(w, "pub mod port {{")?; writeln!(w, "pub mod port {{")?;
writeln!(w, " use super::*;")?; writeln!(w, " use super::*;")?;
writeln!(w, " use Pin;")?; writeln!(w, " use crate::Pin;")?;
writeln!(w)?; writeln!(w)?;
for instance in port.instances.iter() { for instance in port.instances.iter() {

View File

@ -1,4 +1,4 @@
use config; use crate::config;
/// A clock mask. /// A clock mask.
/// ///

View File

@ -4,7 +4,7 @@ mod clock;
// FIXME: Start using this module or delete!!! // FIXME: Start using this module or delete!!!
#[allow(dead_code)] mod settings; #[allow(dead_code)] mod settings;
use {Register, Pin}; use crate::{Register, Pin};
/// An SPI module. /// An SPI module.
/// ///

View File

@ -1,4 +1,4 @@
use {RegisterBits, Register}; use crate::{RegisterBits, Register};
use core::marker; use core::marker;
/// A 16-bit timer. /// A 16-bit timer.

View File

@ -1,4 +1,4 @@
use {RegisterBits, Register}; use crate::{RegisterBits, Register};
use core::marker; use core::marker;
/// A 8-bit timer. /// A 8-bit timer.

View File

@ -1,4 +1,4 @@
use Register; use crate::Register;
pub trait HardwareUsart { pub trait HardwareUsart {
/// The USART data register. /// The USART data register.

View File

@ -1,4 +1,4 @@
use Register; use crate::Register;
/// Represents whether a pin is an input or an output. /// Represents whether a pin is an input or an output.
pub enum DataDirection { pub enum DataDirection {

View File

@ -1,4 +1,4 @@
//! Re-exports commonly-used APIs that can be imported at once. //! Re-exports commonly-used APIs that can be imported at once.
pub use interrupt::without_interrupts; pub use crate::interrupt::without_interrupts;