(&mut self, byte: u8)
| 56 | |
| 57 | impl Writer { |
| 58 | pub fn write_byte(&mut self, byte: u8) { |
| 59 | match byte { |
| 60 | b'\n' => self.new_line(), |
| 61 | byte => { |
| 62 | if self.column_position >= BUFFER_WIDTH { |
| 63 | self.new_line(); |
| 64 | } |
| 65 | |
| 66 | let row = BUFFER_HEIGHT - 1; |
| 67 | let col = self.column_position; |
| 68 | |
| 69 | let color_code = self.color_code; |
| 70 | self.buffer.chars[row][col].write(ScreenChar { |
| 71 | ascii_character: byte, |
| 72 | color_code, |
| 73 | }); |
| 74 | self.column_position += 1; |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | fn new_line(&mut self) { |
| 80 | for row in 1..BUFFER_HEIGHT { |
no test coverage detected