1
0
Fork 0
forked from koniifer/ableos

chore: fmt

This commit is contained in:
Erin 2022-02-18 19:25:54 +01:00 committed by ondra05
parent 38a8ae6e20
commit ca743955c5
14 changed files with 793 additions and 796 deletions

View file

@ -1,3 +1,3 @@
//! //!
pub mod window;
pub mod compositor; pub mod compositor;
pub mod window;

View file

@ -1,4 +1,6 @@
use crate::{KeyCode, ScancodeSet, DecodeState, KeyEvent, Error, KeyState, keyboard::EXTENDED_KEY_CODE}; use crate::{
keyboard::EXTENDED_KEY_CODE, DecodeState, Error, KeyCode, KeyEvent, KeyState, ScancodeSet,
};
pub struct CustomScancodeSet { pub struct CustomScancodeSet {
single_byte: [Option<KeyCode>; 256], single_byte: [Option<KeyCode>; 256],

View file

@ -78,8 +78,7 @@ impl LayoutEntry {
} }
#[must_use] #[must_use]
pub fn common(self, c: impl Into<DecodedKey> + Clone) -> Self { pub fn common(self, c: impl Into<DecodedKey> + Clone) -> Self {
self self.unshifted(c.clone())
.unshifted(c.clone())
.shifted(c.clone()) .shifted(c.clone())
.locked(c.clone()) .locked(c.clone())
.locked_shifted(c) .locked_shifted(c)
@ -94,8 +93,7 @@ impl LayoutEntry {
} }
#[must_use] #[must_use]
pub fn all(self, c: impl Into<DecodedKey> + Clone) -> Self { pub fn all(self, c: impl Into<DecodedKey> + Clone) -> Self {
self self.unshifted(c.clone())
.unshifted(c.clone())
.shifted(c.clone()) .shifted(c.clone())
.locked(c.clone()) .locked(c.clone())
.locked_shifted(c.clone()) .locked_shifted(c.clone())

View file

@ -1,5 +1,4 @@
use alloc::{boxed::Box}; use alloc::boxed::Box;
pub struct BinCodeWriter { pub struct BinCodeWriter {
pub stream: Box<u8>, pub stream: Box<u8>,

View file

@ -20,7 +20,6 @@ lazy_static::lazy_static! {
pub static ref VGAE_BUFF_OFFSET_Y: spin::Mutex<u8> = spin::Mutex::new(0); pub static ref VGAE_BUFF_OFFSET_Y: spin::Mutex<u8> = spin::Mutex::new(0);
} }
/// Converts a number to ... i forgor 💀 /// Converts a number to ... i forgor 💀
pub fn num_to_vga16(num: u8) -> Color16 { pub fn num_to_vga16(num: u8) -> Color16 {
use Color16::*; use Color16::*;

View file

@ -55,7 +55,8 @@ fn main() -> anyhow::Result<()> {
).run()?; ).run()?;
} }
MachineType::RISCV => { MachineType::RISCV => {
xshell::cmd!("cargo build --release --target=riscv64gc-unknown-none-elf").run()?; xshell::cmd!("cargo build --release --target=riscv64gc-unknown-none-elf")
.run()?;
#[rustfmt::skip] #[rustfmt::skip]
xshell::cmd!( xshell::cmd!(
"qemu-system-riscv64 "qemu-system-riscv64
@ -78,7 +79,8 @@ fn main() -> anyhow::Result<()> {
xshell::cmd!("cargo doc --open").run()?; xshell::cmd!("cargo doc --open").run()?;
} }
MachineType::ARM => { MachineType::ARM => {
xshell::cmd!("cargo doc --open --target=json_targets/aarch64-ableos.json").run()?; xshell::cmd!("cargo doc --open --target=json_targets/aarch64-ableos.json")
.run()?;
} }
MachineType::RISCV => { MachineType::RISCV => {
xshell::cmd!("cargo doc --open --target=riscv64gc-unknown-none-elf").run()?; xshell::cmd!("cargo doc --open --target=riscv64gc-unknown-none-elf").run()?;

View file

@ -19,20 +19,17 @@ pub fn get_a(rgba: Rgba64) -> u8 {
} }
pub fn set_r(rgba: Rgba64, r: u8) -> Rgba64 { pub fn set_r(rgba: Rgba64, r: u8) -> Rgba64 {
rgba rgba.bitand(0xffffffff_00_ff_ff_ff)
.bitand(0xffffffff_00_ff_ff_ff)
.bitor((r as Rgba64).shr(0o30)) .bitor((r as Rgba64).shr(0o30))
} }
pub fn set_g(rgba: Rgba64, g: u8) -> Rgba64 { pub fn set_g(rgba: Rgba64, g: u8) -> Rgba64 {
rgba rgba.bitand(0xffffffff_ff_00_ff_ff)
.bitand(0xffffffff_ff_00_ff_ff)
.bitor((g as Rgba64).shr(0o20)) .bitor((g as Rgba64).shr(0o20))
} }
pub fn set_b(rgba: Rgba64, b: u8) -> Rgba64 { pub fn set_b(rgba: Rgba64, b: u8) -> Rgba64 {
rgba rgba.bitand(0xffffffff_ff_ff_00_ff)
.bitand(0xffffffff_ff_ff_00_ff)
.bitor((b as Rgba64).shr(0o10)) .bitor((b as Rgba64).shr(0o10))
} }