mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 14:57:49 +00:00
ColorCode::new does not need to be a const fn
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#![feature(lang_items)] // required for defining the panic handler
|
||||
#![feature(const_fn)] // allow declaring functions as const
|
||||
#![no_std] // don't link the Rust standard library
|
||||
#![cfg_attr(not(test), no_main)] // disable all Rust-level entry points
|
||||
#![cfg_attr(test, allow(dead_code, unused_macros))] // allow unused code in test mode
|
||||
|
||||
@@ -42,7 +42,7 @@ struct ColorCode(u8);
|
||||
|
||||
impl ColorCode {
|
||||
/// Create a new `ColorCode` with the given foreground and background colors.
|
||||
const fn new(foreground: Color, background: Color) -> ColorCode {
|
||||
fn new(foreground: Color, background: Color) -> ColorCode {
|
||||
ColorCode((background as u8) << 4 | (foreground as u8))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user