Skip to content

Commit

Permalink
small refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
Woife5 committed Aug 27, 2023
1 parent cc3a25d commit 3946b4c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
ARCHIVE_TYPES: ${{ matrix.archive }}
ARCHIVE_NAME: ${{ matrix.name }}
UPLOAD_MODE: none
MINIFY: true
# MINIFY: true # this currently causes windows defender to block the binary
- name: Upload artifact
uses: actions/upload-release-asset@v1
env:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "kopfrechner"
authors = ["Wolfgang Schwendtbauer"]
repository = "https://github.com/Woife5/kopfrechner"
version = "0.1.4"
version = "0.1.5"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
21 changes: 8 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ pub fn run() {
.interact_opt();

let range = match range {
Ok(v) => match v {
Some(v) => Config::get_variant(v),
None => break,
},
Err(..) => {
Ok(Some(v)) => Config::get_variant(v),
_ => {
println!("No variant selected, exiting program.");
return;
}
Expand Down Expand Up @@ -63,18 +60,16 @@ fn run_multiply(config: Config) {
.expect("Failed to read from stdin");
let input_text = input_text.trim();

match input_text.parse::<usize>() {
Ok(i) => break i,
Err(..) => match input_text {
"q" => break 'outer,
"exit" => break 'outer,
"quit" => break 'outer,
_ => {
match input_text {
"q" | "exit" | "quit" => break 'outer,
_ => match input_text.parse::<usize>() {
Ok(v) => break v,
Err(_) => {
println!("\rNot a valid number, try again.");
continue;
}
},
};
}
};

let elapsed = start_time.elapsed();
Expand Down

0 comments on commit 3946b4c

Please sign in to comment.