Make constructors const

This commit is contained in:
Daniel Beckwith 2020-03-31 18:29:41 -04:00
parent 6547019382
commit 19d41fd146
5 changed files with 10 additions and 10 deletions

View file

@ -90,8 +90,8 @@ impl GraphicsWriter<u8> for Graphics320x200x256 {
impl Graphics320x200x256 { impl Graphics320x200x256 {
/// Creates a new `Graphics320x200x256`. /// Creates a new `Graphics320x200x256`.
pub fn new() -> Graphics320x200x256 { pub const fn new() -> Graphics320x200x256 {
Graphics320x200x256 {} Graphics320x200x256
} }
/// Returns the start of the `FrameBuffer` as `*mut u8` as /// Returns the start of the `FrameBuffer` as `*mut u8` as

View file

@ -102,8 +102,8 @@ impl GraphicsWriter<Color16> for Graphics640x480x16 {
impl Graphics640x480x16 { impl Graphics640x480x16 {
/// Creates a new `Graphics640x480x16`. /// Creates a new `Graphics640x480x16`.
pub fn new() -> Graphics640x480x16 { pub const fn new() -> Graphics640x480x16 {
Graphics640x480x16 {} Graphics640x480x16
} }
fn set_write_mode_0(&self, color: Color16) { fn set_write_mode_0(&self, color: Color16) {

View file

@ -51,7 +51,7 @@ impl TextWriter for Text40x25 {
impl Text40x25 { impl Text40x25 {
/// Creates a new `Text40x25`. /// Creates a new `Text40x25`.
pub fn new() -> Text40x25 { pub const fn new() -> Text40x25 {
Text40x25 {} Text40x25
} }
} }

View file

@ -51,7 +51,7 @@ impl TextWriter for Text40x50 {
impl Text40x50 { impl Text40x50 {
/// Creates a new `Text40x50`. /// Creates a new `Text40x50`.
pub fn new() -> Text40x50 { pub const fn new() -> Text40x50 {
Text40x50 {} Text40x50
} }
} }

View file

@ -50,7 +50,7 @@ impl TextWriter for Text80x25 {
impl Text80x25 { impl Text80x25 {
/// Creates a new `Text80x25`. /// Creates a new `Text80x25`.
pub fn new() -> Text80x25 { pub const fn new() -> Text80x25 {
Text80x25 {} Text80x25
} }
} }