summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Geary <rtgnj42@gmail.com>2019-09-06 16:26:26 -0400
committerRyan Geary <rtgnj42@gmail.com>2019-09-06 16:26:26 -0400
commitbe24d64a60ea4280823705f1cb600b0d65b78a7a (patch)
treea74fc2f5baeb57f8aaa709faf7ac23468609e9b0
parent2b299ad9c1a55e1b011928caad30b4e2063da6f4 (diff)
change parse_range -> parse_choice
-rw-r--r--src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 8a5f325..5f504f4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -17,7 +17,7 @@ enum Choice {
#[structopt(name = "choose", about = "`choose` sections from each line of files")]
struct Opt {
/// Capture range of fields
- #[structopt(parse(try_from_str = parse_range))]
+ #[structopt(parse(try_from_str = parse_choice))]
choice: Choice,
/// Specify field separator other than whitespace
@@ -54,7 +54,7 @@ fn main() {
println!("Hello, world!");
}
-fn parse_range(src: &str) -> Result<Choice, ParseIntError> {
+fn parse_choice(src: &str) -> Result<Choice, ParseIntError> {
let re = Regex::new(r"^(\d*):(\d*)$").unwrap();
let cap = match re.captures_iter(src).next() {