INDAPlus21 / INDAPlus21/murnion-sorting
Pass
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
**Well done Felix!**
Huhuhuhuh... Heard of error handling?
_After `cargo run` and 'mouse click'_:
```
PS C:\Users\viola\Documents\INDA_2021\tasks\plus-sorting\murnion\murnion-sorting> cargo run
[...]
warning: `murnion-task-11` (bin "murnion-task-11") generated 31 warnings
Finished dev [unoptimized + debuginfo] target(s) in 1m 06s
Running `target\debug\murnion-task-11.exe`
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', src\main.rs:85:15
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\murnion-task-11.exe` (exit code: 101)
```
_Your code_:
```rs
fn mouse_button_up_event(&mut self, ctx: &mut Context, button: MouseButton, x: f32, y: f32) {
//...
let args: Vec = env::args().collect();
match args[1].to_lowercase().as_str() {/*...*/}
}
```
Your code would look more structured if the sorting algorithms were distributed in seperate functions, but your approach is totally fine as well. It's personal preference in the end.
I like your wide selection of sorting algorithms!
Keep it up!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/main.rs at line 85 and reproduce the panic with cargo run followed by the mouse click described in the issue. Trace how command-line arguments are accessed and make the behavior handle missing arguments without panicking; rerun cargo run to confirm the program exits or responds cleanly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100