Skip to content

Commit

Permalink
refactor codes in main.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
gamoutatsumi committed Dec 14, 2020
1 parent 731c58b commit f35234d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ojichat-cli"
version = "0.1.1"
version = "0.1.2"
authors = ["Tatsumi Gamou <[email protected]>"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ fn main() {
let matches = app.get_matches();
let target: Option<String>;

let emoji_num = Some(value_t!(matches.value_of("e"), usize).unwrap_or_default());
let emoji_num = matches.value_of("e").map(|o| o.parse().unwrap());

let punctuation_level = Some(value_t!(matches.value_of("p"), usize).unwrap_or_default());
let punctuation_level = matches.value_of("p").map(|o| o.parse().unwrap());

if let Some(o) = matches.value_of("name") {
target = Some(o.to_string());
Expand Down

0 comments on commit f35234d

Please sign in to comment.