Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to Ignore arguments #29

Merged
merged 5 commits into from
Nov 26, 2023

Conversation

masonium
Copy link
Contributor

@masonium masonium commented Nov 8, 2023

This PR adds an Ignore parameter to the memoize macro, allowing the user to mark one or more function arguments to not participate in the memoization. As a result, any Ignored argument does not need to implement Clone or Hash, and changes to those arguments do not trigger re-invoking the original function.

@masonium masonium changed the title Ignore parameter Add ability to Ignore arguments Nov 8, 2023
@dermesser
Copy link
Owner

Looks good - but this feature isn't gated on the full feature, is it? that's what makes the CI fail currently.

@masonium
Copy link
Contributor Author

masonium commented Nov 9, 2023

Thanks, yeah I forgot to remove the 'full' feature gate from the example, and it doesn't require it.

@masonium
Copy link
Contributor Author

Sorry for the churn here. I found the issue with my most recent branch: I was checking for the first argument using sig.inputs[0] instead of sig.inputs.first(), which obviously fails for functions with no arguments.

I also ran the tests locally matching the matrix used in .github/workflows/test.yml, so the CI should go through.

@masonium
Copy link
Contributor Author

Let me know if you need anything else from the PR. Happy holidays!

@dermesser dermesser merged commit cb5878e into dermesser:master Nov 26, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants