Skip to content

Commit

Permalink
Pass ParameterParser as &mut
Browse files Browse the repository at this point in the history
Summary: To add assertion in D63280260.

Reviewed By: JakobDegen

Differential Revision: D63280259

fbshipit-source-id: d4694bedcc966a396a339385569c3e572c4d410a
  • Loading branch information
stepancheg authored and facebook-github-bot committed Sep 24, 2024
1 parent 5381de0 commit db1c700
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions starlark/src/eval/runtime/params/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,15 +857,15 @@ impl<'v> ParametersSpec<Value<'v>> {
k: F,
) -> crate::Result<R>
where
F: FnOnce(ParametersParser<'v, '_>, &mut Evaluator<'v, '_, '_>) -> crate::Result<R>,
F: FnOnce(&mut ParametersParser<'v, '_>, &mut Evaluator<'v, '_, '_>) -> crate::Result<R>,
{
eval.alloca_init(
self.len(),
|| Cell::new(None),
|slots, eval| {
self.collect_inline(&args.0, slots, eval.heap())?;
let parser = ParametersParser::new(slots);
k(parser, eval)
let mut parser = ParametersParser::new(slots);
k(&mut parser, eval)
},
)
}
Expand Down Expand Up @@ -921,7 +921,7 @@ impl<'v, V: ValueLike<'v>> ParametersSpec<V> {
k: F,
) -> crate::Result<R>
where
F: FnOnce(ParametersParser<'v, '_>, &mut Evaluator<'v, '_, '_>) -> crate::Result<R>,
F: FnOnce(&mut ParametersParser<'v, '_>, &mut Evaluator<'v, '_, '_>) -> crate::Result<R>,
{
self.as_value().parser_impl(args, eval, k)
}
Expand Down
2 changes: 1 addition & 1 deletion starlark/src/values/types/record/record_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ where
let this = me;

self.parameter_spec
.parser(args, eval, |mut param_parser, eval| {
.parser(args, eval, |param_parser, eval| {
let fields = record_fields(RecordType::from_value(this).unwrap());
let mut values = Vec::with_capacity(fields.len());
for (name, field) in fields.iter() {
Expand Down

0 comments on commit db1c700

Please sign in to comment.