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

Remove unnecessary &mut self in SQS implementation #84

Merged
merged 2 commits into from May 13, 2024

Conversation

svix-gabriel
Copy link
Contributor

@svix-gabriel svix-gabriel commented May 10, 2024

While attempting to use the SQS implementation, I ran into papercuts with the consumer because receive() methods took self by mutable reference.

These, uhh, don't need to do that. I realize the general Consumer traits takes a mutable reference because some underlying implementations require an immutable ref. But when calling the SQS Consumer methods directly, rather than through the consumer trait, this mutable reference is just annoying.

When I made this change, my linter started complaining about unbounded recursion from the macro definitions for implementing the consumer traits. Changing the macros to use the fully qualified struct syntax (e.g. Struct::method instead of &self.method) seems to fix this?

@svix-gabriel svix-gabriel changed the title Fix macro-generated recursion and unnecessary &mut self in SQS implementation Remove unnecessary &mut self in SQS implementation May 10, 2024
@svix-gabriel svix-gabriel marked this pull request as ready for review May 10, 2024 21:28
@svix-gabriel svix-gabriel requested a review from a team as a code owner May 10, 2024 21:28
@svix-jplatte svix-jplatte merged commit 94bf7bb into main May 13, 2024
4 checks passed
@svix-jplatte svix-jplatte deleted the gabriel/immut-sqs branch May 13, 2024 08:13
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.

None yet

2 participants