Suggest a list of possible arg labels when an argument is unlabelled (#6755)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -62,6 +62,7 @@ pub struct KwArgs {
|
||||
pub unlabeled: Option<Arg>,
|
||||
/// Labeled args.
|
||||
pub labeled: IndexMap<String, Arg>,
|
||||
pub errors: Vec<Arg>,
|
||||
}
|
||||
|
||||
impl KwArgs {
|
||||
|
@ -88,6 +88,7 @@ async fn call_map_closure(
|
||||
let kw_args = KwArgs {
|
||||
unlabeled: Some(Arg::new(input, source_range)),
|
||||
labeled: Default::default(),
|
||||
errors: Vec::new(),
|
||||
};
|
||||
let args = Args::new_kw(
|
||||
kw_args,
|
||||
@ -233,6 +234,7 @@ async fn call_reduce_closure(
|
||||
let kw_args = KwArgs {
|
||||
unlabeled: Some(Arg::new(elem, source_range)),
|
||||
labeled,
|
||||
errors: Vec::new(),
|
||||
};
|
||||
let reduce_fn_args = Args::new_kw(
|
||||
kw_args,
|
||||
|
@ -430,6 +430,7 @@ async fn make_transform<T: GeometryTrait>(
|
||||
let kw_args = KwArgs {
|
||||
unlabeled: Some(Arg::new(repetition_num, source_range)),
|
||||
labeled: Default::default(),
|
||||
errors: Vec::new(),
|
||||
};
|
||||
let transform_fn_args = Args::new_kw(
|
||||
kw_args,
|
||||
|
Reference in New Issue
Block a user