added list len, front, and back
This commit is contained in:
parent
06d30ac263
commit
7fd47c1812
5 changed files with 215 additions and 12 deletions
|
|
@ -145,14 +145,15 @@ impl Args {
|
|||
} else {
|
||||
return Err("expected no args".to_string());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Args::Infinite => {
|
||||
if !args.is_empty() {
|
||||
return Ok(());
|
||||
} else {
|
||||
return Err("expected args but none were provided".to_string());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Args::Lazy(ref num) => {
|
||||
let called_arg_count = args.len();
|
||||
|
|
@ -167,7 +168,7 @@ impl Args {
|
|||
} else if let Ctr::None = *args.car {
|
||||
return Err(format!("expected {} args. Got 0.", num,));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Args::Strict(ref arg_types) => {
|
||||
let mut idx: usize = 0;
|
||||
|
|
@ -202,7 +203,7 @@ impl Args {
|
|||
return Err("too few arguments".to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue