Skip to content

Conversation

@findepi
Copy link
Member

@findepi findepi commented Feb 5, 2025

Add a take_function_args helper that provides convenient unpacking of function arguments along with validation that the provided argument count matches the expected. A few functions are updated to leverage the new pattern to demonstrate its usefulness.

Add a `take_function_args` helper that provides convenient unpacking of
function arguments along with validation that the provided argument
count matches the expected.  A few functions are updated to leverage the
new pattern to demonstrate its usefulness.
@github-actions github-actions bot added the functions Changes to functions implementation label Feb 5, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love it -- thank you @findepi

BTW I bet others would love a chance to clean up the code using this function if we filed a ticket for them to do so.

findepi and others added 3 commits February 5, 2025 06:59
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
this exports only the newly added take_function_args function. all other
utils members are pub(crate)
@findepi findepi requested a review from goldmedal February 5, 2025 15:05
findepi and others added 3 commits February 5, 2025 07:34
Co-authored-by: Matthijs Brobbel <m1brobbel@gmail.com>
findepi and others added 2 commits February 5, 2025 09:01
Co-authored-by: Oleks V <comphead@users.noreply.github.com>
Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks @findepi

@findepi
Copy link
Member Author

findepi commented Feb 5, 2025

thank you @alamb @mbrobbel @comphead for your reviews!

BTW I bet others would love a chance to clean up the code using this function if we filed a ticket for them to do so.

@findepi findepi merged commit 5239d1a into apache:main Feb 5, 2025
25 checks passed
@findepi findepi deleted the findepi/validate-and-unpack-function-arguments-tersely-a318e2 branch February 5, 2025 22:01
@alamb
Copy link
Contributor

alamb commented Feb 7, 2025

thank you @alamb @mbrobbel @comphead for your reviews!

BTW I bet others would love a chance to clean up the code using this function if we filed a ticket for them to do so.

And we already have a taker: #14516 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants