Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filler panics when given grid is already filled #135

Open
super7ramp opened this issue Mar 1, 2023 · 0 comments
Open

Filler panics when given grid is already filled #135

super7ramp opened this issue Mar 1, 2023 · 0 comments

Comments

@super7ramp
Copy link

Issue

Filler panics when given grid is already filled. That's a very minor corner case but still :)

Steps to reproduce

  1. Create the following file in grids/filled_4x4.txt
CFOS
BIRI
CCCV
SASA
  1. Call the filler using command-line interface: ./target/debug/xwords --input grids/filled_4x4.txt

Expected result

The grid is returned as is since it is valid.

Actual result

> ./target/debug/xwords --input grids/filled_4x4.txt 
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/fill/filler.rs:76:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/panicking.rs:65:14
   2: core::panicking::panic
             at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/panicking.rs:115:5
   3: core::option::Option<T>::unwrap
             at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/option.rs:778:21
   4: <xwords::fill::filler::Filler as xwords::fill::Fill>::fill
             at ./src/fill/filler.rs:65:27
   5: xwords::main
             at ./src/bin/xwords.rs:66:18
   6: core::ops::function::FnOnce::call_once
             at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/ops/function.rs:251:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
>

Environment

stable-x86_64-unknown-linux-gnu (default)
rustc 1.66.1 (90743e729 2023-01-10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant