Make constructors const

pull/12/head
Daniel Beckwith 2020-03-31 18:29:41 -04:00
parent 9cf310e462
commit ecd8f2fea9
5 changed files with 10 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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

View File

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