From 983550ae5456495297852ba1f6f59ed3b0160636 Mon Sep 17 00:00:00 2001 From: TheOddGarlic Date: Mon, 1 Aug 2022 13:50:07 +0300 Subject: [PATCH] chore: cargo fmt --- ableos/src/devices/pci/mod.rs | 9 ++++----- ableos/src/scratchpad.rs | 2 +- qrcode-rust/src/render/image.rs | 2 +- qrcode-rust/src/render/svg.rs | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ableos/src/devices/pci/mod.rs b/ableos/src/devices/pci/mod.rs index 9ece944..ce3fc5a 100644 --- a/ableos/src/devices/pci/mod.rs +++ b/ableos/src/devices/pci/mod.rs @@ -175,10 +175,10 @@ unsafe fn pci_config_read(bus: u8, device: u8, func: u8, offset: u8) -> u32 { ((bus << 16) | (device << 11) | (func << 8) | (offset & 0xfc) | 0x80000000) as u32; // write address - Port::::new(0xCF8).write(address); + Port::::new(0xCF8).write(address); // read data - Port::::new(0xCFC).read() + Port::::new(0xCFC).read() } #[allow(dead_code)] @@ -192,11 +192,10 @@ unsafe fn pci_config_write(bus: u8, device: u8, func: u8, offset: u8, value: u32 ((bus << 16) | (device << 11) | (func << 8) | (offset & 0xfc) | 0x80000000) as u32; // write address - Port::::new(0xCF8).write(address); + Port::::new(0xCF8).write(address); // write data - Port::::new(0xCFC).write(value); - + Port::::new(0xCFC).write(value); } fn get_header_type(bus: u8, device: u8, function: u8) -> u8 { diff --git a/ableos/src/scratchpad.rs b/ableos/src/scratchpad.rs index da46071..dc63ff8 100644 --- a/ableos/src/scratchpad.rs +++ b/ableos/src/scratchpad.rs @@ -174,7 +174,7 @@ pub fn command_parser(user: String, command: String) { options.read(true); let file = { let path = format!("/home/{user}/bins/{bin_name}.wasm"); - if let Ok(file ) = fs.open(&path.as_bytes(), &options) { + if let Ok(file) = fs.open(&path.as_bytes(), &options) { file } else { let path = format!("/shared/bins/{bin_name}.wasm"); diff --git a/qrcode-rust/src/render/image.rs b/qrcode-rust/src/render/image.rs index d42776b..5a3974c 100644 --- a/qrcode-rust/src/render/image.rs +++ b/qrcode-rust/src/render/image.rs @@ -1,4 +1,4 @@ -#![cfg(feature="image")] +#![cfg(feature = "image")] use crate::render::{Canvas, Pixel}; use crate::types::Color; diff --git a/qrcode-rust/src/render/svg.rs b/qrcode-rust/src/render/svg.rs index de4dedf..ba85fbd 100644 --- a/qrcode-rust/src/render/svg.rs +++ b/qrcode-rust/src/render/svg.rs @@ -10,7 +10,7 @@ //! let svg_xml = code.render::().build(); //! println!("{}", svg_xml); -#![cfg(feature="svg")] +#![cfg(feature = "svg")] use std::fmt::Write; use std::marker::PhantomData;