survivor

graphical action game for the linux terminal
git clone https://git.ce9e.org/survivor.git

commit
c896a144668c4e27a4ab8074179f911c9565656f
parent
b146e875b7faeda00f152ba26d5237612464b0bb
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-02-21 21:18
use Self in new()

Diffstat

M src/input.rs 4 ++--
M src/term.rs 4 ++--

2 files changed, 4 insertions, 4 deletions


diff --git a/src/input.rs b/src/input.rs

@@ -7,7 +7,7 @@ pub struct Input {
    7     7 }
    8     8 
    9     9 impl Input {
   10    -1     pub fn new() -> Input {
   -1    10     pub fn new() -> Self {
   11    11         let mut t = libc::termios {
   12    12             c_iflag: 0,
   13    13             c_oflag: 0,
@@ -22,7 +22,7 @@ impl Input {
   22    22             libc::tcgetattr(0, &mut t);
   23    23         }
   24    24 
   25    -1         let input = Input { termios: t };
   -1    25         let input = Self { termios: t };
   26    26         input.cbreak();
   27    27         return input;
   28    28     }

diff --git a/src/term.rs b/src/term.rs

@@ -104,8 +104,8 @@ impl Drop for Screen {
  104   104 }
  105   105 
  106   106 impl Screen {
  107    -1     pub fn new() -> Screen {
  108    -1         let mut screen = Screen { width: 0, height: 0, pixels: vec![] };
   -1   107     pub fn new() -> Self {
   -1   108         let mut screen = Self { width: 0, height: 0, pixels: vec![] };
  109   109         screen.resize();
  110   110         ti::civis();
  111   111         ti::ed();