Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
wooster0 committed Aug 19, 2021
1 parent 09e3755 commit 147841d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/event/input/mouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ fn confirmation_prompt(

// Temporarily set the builder grid size back to the old size to render the alert properly.
let new_grid_size = builder.grid.size.clone();
builder.grid.size = original_grid_size.clone();
builder.grid.size = original_grid_size;
alert::draw(terminal, builder, alert, message);
builder.grid.size = new_grid_size;

Expand Down
2 changes: 1 addition & 1 deletion src/event/input/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub fn await_fitting_size(terminal: &mut Terminal, grid: &Grid) -> State {
}
}

pub fn await_resize(terminal: &mut Terminal) -> State {
fn await_resize(terminal: &mut Terminal) -> State {
loop {
let event = terminal.read_event();
match event {
Expand Down
12 changes: 4 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,15 @@ fn main() {
process::exit(code);
}

const HELP: &[&str] = &[
"Play nonograms/picross in your terminal.",
"For the arguments please check <https://github.com/r00ster91/yayagram#command-line-arguments>.",
];

fn run() -> Result<(), Cow<'static, str>> {
let arg = args::parse();

let grid = match arg {
Ok(Some(args::Arg::Help)) => {
for line in HELP {
println!("{}", line);
}
println!(concat!(
"Play nonograms/picross in your terminal.\n",
"For the arguments please check <https://github.com/r00ster91/yayagram#command-line-arguments>."
));

return Ok(());
}
Expand Down

0 comments on commit 147841d

Please sign in to comment.