Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ecd8f2f

Browse filesBrowse files
committed
Make constructors const
1 parent 9cf310e commit ecd8f2f
Copy full SHA for ecd8f2f

File tree

Expand file treeCollapse file tree

5 files changed

+10
-10
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+10
-10
lines changed

‎src/writers/graphics_320x200x256.rs

Copy file name to clipboardExpand all lines: src/writers/graphics_320x200x256.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ impl GraphicsWriter<u8> for Graphics320x200x256 {
9090

9191
impl Graphics320x200x256 {
9292
/// Creates a new `Graphics320x200x256`.
93-
pub fn new() -> Graphics320x200x256 {
94-
Graphics320x200x256 {}
93+
pub const fn new() -> Graphics320x200x256 {
94+
Graphics320x200x256
9595
}
9696

9797
/// Returns the start of the `FrameBuffer` as `*mut u8` as

‎src/writers/graphics_640x480x16.rs

Copy file name to clipboardExpand all lines: src/writers/graphics_640x480x16.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ impl GraphicsWriter<Color16> for Graphics640x480x16 {
102102

103103
impl Graphics640x480x16 {
104104
/// Creates a new `Graphics640x480x16`.
105-
pub fn new() -> Graphics640x480x16 {
106-
Graphics640x480x16 {}
105+
pub const fn new() -> Graphics640x480x16 {
106+
Graphics640x480x16
107107
}
108108

109109
fn set_write_mode_0(&self, color: Color16) {

‎src/writers/text_40x25.rs

Copy file name to clipboardExpand all lines: src/writers/text_40x25.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl TextWriter for Text40x25 {
5151

5252
impl Text40x25 {
5353
/// Creates a new `Text40x25`.
54-
pub fn new() -> Text40x25 {
55-
Text40x25 {}
54+
pub const fn new() -> Text40x25 {
55+
Text40x25
5656
}
5757
}

‎src/writers/text_40x50.rs

Copy file name to clipboardExpand all lines: src/writers/text_40x50.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl TextWriter for Text40x50 {
5151

5252
impl Text40x50 {
5353
/// Creates a new `Text40x50`.
54-
pub fn new() -> Text40x50 {
55-
Text40x50 {}
54+
pub const fn new() -> Text40x50 {
55+
Text40x50
5656
}
5757
}

‎src/writers/text_80x25.rs

Copy file name to clipboardExpand all lines: src/writers/text_80x25.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl TextWriter for Text80x25 {
5050

5151
impl Text80x25 {
5252
/// Creates a new `Text80x25`.
53-
pub fn new() -> Text80x25 {
54-
Text80x25 {}
53+
pub const fn new() -> Text80x25 {
54+
Text80x25
5555
}
5656
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.