From: HimbeerserverDE Date: Tue, 20 Sep 2022 15:18:06 +0000 (+0200) Subject: Less operators X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=34e6bf29d4d83cef3a44e80052167e13807974bb;p=loadnothing.git Less operators --- diff --git a/stage2/src/vga.rs b/stage2/src/vga.rs index fa4a499..efa492e 100644 --- a/stage2/src/vga.rs +++ b/stage2/src/vga.rs @@ -1,4 +1,4 @@ -use core::ops::{AddAssign, Deref, DerefMut, Shl, Sub}; +use core::ops::{AddAssign, BitOr, Deref, DerefMut, Shl, Sub}; use lazy_static::lazy_static; use spin::Mutex; @@ -32,7 +32,7 @@ pub struct ColorCode(u8); impl ColorCode { pub fn new(foreground: Color, background: Color) -> ColorCode { - ColorCode((background as u8).shl(4) | (foreground as u8)) + ColorCode(((background as u8).shl(4) as u8).bitor(foreground as u8)) } }