mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-30 09:22:38 +02:00
cargo fmt with imports_granularity = "module" (#564)
This commit is contained in:
parent
0d30da7f23
commit
87f1976589
src
bare-metal
alloc-example/src
aps/examples/src
microcontrollers/examples/src/bin
exercises/bare-metal
@ -19,7 +19,8 @@
|
||||
extern crate alloc;
|
||||
extern crate panic_halt as _;
|
||||
|
||||
use alloc::{string::ToString, vec::Vec};
|
||||
use alloc::string::ToString;
|
||||
use alloc::vec::Vec;
|
||||
use buddy_system_allocator::LockedHeap;
|
||||
|
||||
#[global_allocator]
|
||||
|
@ -20,7 +20,8 @@ mod exceptions;
|
||||
mod pl011;
|
||||
|
||||
use crate::pl011::Uart;
|
||||
use core::{fmt::Write, panic::PanicInfo};
|
||||
use core::fmt::Write;
|
||||
use core::panic::PanicInfo;
|
||||
use log::error;
|
||||
use psci::system_off;
|
||||
|
||||
|
@ -20,7 +20,8 @@ mod exceptions;
|
||||
mod pl011_minimal;
|
||||
|
||||
use crate::pl011_minimal::Uart;
|
||||
use core::{fmt::Write, panic::PanicInfo};
|
||||
use core::fmt::Write;
|
||||
use core::panic::PanicInfo;
|
||||
use log::error;
|
||||
use psci::system_off;
|
||||
|
||||
|
@ -12,10 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use core::{
|
||||
fmt::{self, Write},
|
||||
ptr::{addr_of, addr_of_mut},
|
||||
};
|
||||
use core::fmt::{self, Write};
|
||||
use core::ptr::{addr_of, addr_of_mut};
|
||||
|
||||
// ANCHOR: Flags
|
||||
use bitflags::bitflags;
|
||||
|
@ -38,8 +38,8 @@ fn main() -> ! {
|
||||
if pin_input.is_high().unwrap() {
|
||||
// ...
|
||||
}
|
||||
let mut pin_output: P0_01<Output<OpenDrain>> =
|
||||
pin_input.into_open_drain_output(OpenDrainConfig::Disconnect0Standard1, Level::Low);
|
||||
let mut pin_output: P0_01<Output<OpenDrain>> = pin_input
|
||||
.into_open_drain_output(OpenDrainConfig::Disconnect0Standard1, Level::Low);
|
||||
pin_output.set_high().unwrap();
|
||||
// pin_input.is_high(); // Error, moved.
|
||||
|
||||
|
@ -23,17 +23,13 @@ use cortex_m_rt::entry;
|
||||
// ANCHOR_END: top
|
||||
use core::cmp::{max, min};
|
||||
use lsm303agr::{AccelOutputDataRate, Lsm303agr, MagOutputDataRate};
|
||||
use microbit::{
|
||||
display::blocking::Display,
|
||||
hal::{
|
||||
prelude::*,
|
||||
twim::Twim,
|
||||
uarte::{Baudrate, Parity, Uarte},
|
||||
Timer,
|
||||
},
|
||||
pac::twim0::frequency::FREQUENCY_A,
|
||||
Board,
|
||||
};
|
||||
use microbit::display::blocking::Display;
|
||||
use microbit::hal::prelude::*;
|
||||
use microbit::hal::twim::Twim;
|
||||
use microbit::hal::uarte::{Baudrate, Parity, Uarte};
|
||||
use microbit::hal::Timer;
|
||||
use microbit::pac::twim0::frequency::FREQUENCY_A;
|
||||
use microbit::Board;
|
||||
|
||||
const COMPASS_SCALE: i32 = 30000;
|
||||
const ACCELEROMETER_SCALE: i32 = 700;
|
||||
|
@ -12,10 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use core::{
|
||||
fmt::{self, Write},
|
||||
ptr::{addr_of, addr_of_mut},
|
||||
};
|
||||
use core::fmt::{self, Write};
|
||||
use core::ptr::{addr_of, addr_of_mut};
|
||||
|
||||
// ANCHOR: Flags
|
||||
use bitflags::bitflags;
|
||||
|
Loading…
x
Reference in New Issue
Block a user