Merge pull request #89 from hyperslv/extern_crate_to_use

Replace unidiomatic 'extern crate' to 'use x as _'
This commit is contained in:
Adam Greig
2020-06-14 17:07:38 +01:00
committed by GitHub
9 changed files with 17 additions and 17 deletions

View File

@@ -15,7 +15,7 @@
#![no_std] #![no_std]
extern crate alloc; extern crate alloc;
extern crate panic_halt; use panic_halt as _;
use self::alloc::vec; use self::alloc::vec;
use core::alloc::Layout; use core::alloc::Layout;

View File

@@ -79,7 +79,7 @@
#![no_main] #![no_main]
#![no_std] #![no_std]
extern crate panic_halt; use panic_halt as _;
use core::ptr; use core::ptr;

View File

@@ -26,7 +26,7 @@
#![no_std] #![no_std]
#[allow(unused_extern_crates)] #[allow(unused_extern_crates)]
extern crate panic_halt; use panic_halt as _;
use cortex_m::peripheral::syst::SystClkSource; use cortex_m::peripheral::syst::SystClkSource;
use cortex_m_rt::entry; use cortex_m_rt::entry;

View File

@@ -10,7 +10,7 @@
#![no_main] #![no_main]
#![no_std] #![no_std]
extern crate panic_halt; use panic_halt as _;
use cortex_m::peripheral::syst::SystClkSource; use cortex_m::peripheral::syst::SystClkSource;
use cortex_m::Peripherals; use cortex_m::Peripherals;

View File

@@ -3,7 +3,7 @@
#![no_main] #![no_main]
#![no_std] #![no_std]
extern crate panic_halt; use panic_halt as _;
use cortex_m_rt::entry; use cortex_m_rt::entry;
use cortex_m_semihosting::{debug, hprintln}; use cortex_m_semihosting::{debug, hprintln};

View File

@@ -17,7 +17,7 @@
#![no_main] #![no_main]
#![no_std] #![no_std]
extern crate panic_halt; use panic_halt as _;
use cortex_m::{iprintln, Peripherals}; use cortex_m::{iprintln, Peripherals};
use cortex_m_rt::entry; use cortex_m_rt::entry;

View File

@@ -10,15 +10,15 @@
// Pick one of these panic handlers: // Pick one of these panic handlers:
// `panic!` halts execution; the panic message is ignored // `panic!` halts execution; the panic message is ignored
extern crate panic_halt; use panic_halt as _;
// Reports panic messages to the host stderr using semihosting // Reports panic messages to the host stderr using semihosting
// NOTE to use this you need to uncomment the `panic-semihosting` dependency in Cargo.toml // NOTE to use this you need to uncomment the `panic-semihosting` dependency in Cargo.toml
// extern crate panic_semihosting; // use panic_semihosting as _;
// Logs panic messages using the ITM (Instrumentation Trace Macrocell) // Logs panic messages using the ITM (Instrumentation Trace Macrocell)
// NOTE to use this you need to uncomment the `panic-itm` dependency in Cargo.toml // NOTE to use this you need to uncomment the `panic-itm` dependency in Cargo.toml
// extern crate panic_itm; // use panic_itm as _;
use cortex_m_rt::entry; use cortex_m_rt::entry;

View File

@@ -23,10 +23,10 @@
// pick a panicking behavior // pick a panicking behavior
#[cfg(not(test))] #[cfg(not(test))]
extern crate panic_halt; // you can put a breakpoint on `rust_begin_unwind` to catch panics use panic_halt as _; // you can put a breakpoint on `rust_begin_unwind` to catch panics
// extern crate panic_abort; // requires nightly // use panic_abort as _; // requires nightly
// extern crate panic_itm; // logs messages over ITM; requires ITM support // use panic_itm as _; // logs messages over ITM; requires ITM support
// extern crate panic_semihosting; // logs messages to the host stderr; requires a debugger // use panic_semihosting as _; // logs messages to the host stderr; requires a debugger
use cortex_m::asm; use cortex_m::asm;
use cortex_m_rt::entry; use cortex_m_rt::entry;

View File

@@ -2,10 +2,10 @@
#![no_main] #![no_main]
// pick a panicking behavior // pick a panicking behavior
extern crate panic_halt; // you can put a breakpoint on `rust_begin_unwind` to catch panics use panic_halt as _; // you can put a breakpoint on `rust_begin_unwind` to catch panics
// extern crate panic_abort; // requires nightly // use panic_abort as _; // requires nightly
// extern crate panic_itm; // logs messages over ITM; requires ITM support // use panic_itm as _; // logs messages over ITM; requires ITM support
// extern crate panic_semihosting; // logs messages to the host stderr; requires a debugger // use panic_semihosting as _; // logs messages to the host stderr; requires a debugger
use cortex_m::asm; use cortex_m::asm;
use cortex_m_rt::entry; use cortex_m_rt::entry;