arguments need to be longer

This commit is contained in:
jane 2021-12-28 17:55:37 -05:00
parent b44dc1bd09
commit f72ad4b616

View file

@ -54,7 +54,7 @@ impl Pattern for Value {
} }
} }
fn parse(args: Vec<String>) -> Result<Self, ParseError> { fn parse(args: Vec<String>) -> Result<Self, ParseError> {
let param1 = if args.len() >= 1 { let param1 = if args.len() > 1 {
match args[1].parse::<u8>() { match args[1].parse::<u8>() {
Ok(i) => Some(i), Ok(i) => Some(i),
Err(_) => None Err(_) => None
@ -62,7 +62,7 @@ impl Pattern for Value {
} else { } else {
None None
}; };
let param2 = if args.len() >= 2 { let param2 = if args.len() > 2 {
match args[2].parse::<u8>() { match args[2].parse::<u8>() {
Ok(i) => Some(i), Ok(i) => Some(i),
Err(_) => None Err(_) => None
@ -70,7 +70,7 @@ impl Pattern for Value {
} else { } else {
None None
}; };
let param3 = if args.len() >= 3 { let param3 = if args.len() > 3 {
match args[3].parse::<u8>() { match args[3].parse::<u8>() {
Ok(i) => Some(i), Ok(i) => Some(i),
Err(_) => None Err(_) => None