Skip to content

Commit

Permalink
version as const
Browse files Browse the repository at this point in the history
  • Loading branch information
Kacperacy committed Mar 6, 2024
1 parent 7b72daf commit 696e0d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crossterm::{
terminal::{disable_raw_mode, Clear, ClearType},
};

const VERSION: &str = "0.0.1";

pub struct Editor {
screen_rows: usize,
screen_cols: usize,
Expand All @@ -27,7 +29,7 @@ impl Editor {
pub fn draw_rows(&self) {
for i in 0..self.screen_rows {
if i == self.screen_rows / 3 {
let message = "rust-edit v0.1";
let message = "rust-edit v.".to_string() + VERSION;
let len = message.len();
let padding = (self.screen_cols - len) / 2;
if padding > 0 {
Expand Down

0 comments on commit 696e0d8

Please sign in to comment.