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

Refactor Event wait() method for simplified code #60

Closed
wants to merge 1 commit into from

Conversation

eval-exec
Copy link

This pull request refactors the wait() method of the Event struct to simplify the code and improve readability.

In the original implementation, the method used a loop to check for receiver updates by cloning the receiver and invoking receiver.changed().await.unwrap() within the loop. However, this can be simplified by directly invoking self.receiver.clone().changed().await.unwrap() in a single line.

The refactored code eliminates the need for the loop and makes the intention of waiting for receiver changes clearer. It reduces unnecessary code complexity while maintaining the functionality of the wait() method.

@Finomnis
Copy link
Owner

Finomnis commented Jun 16, 2023

Are you aware that those changes are only for a test, not for the actual library?

@eval-exec
Copy link
Author

Are you aware that those changes are only for a test, not for the actual library?

Certainly, only integration test need Event struct.

@Finomnis
Copy link
Owner

Finomnis commented Jun 16, 2023

Is there something wrong with the existing implementation? Especially as your rework now isn't compatible with repeated wait calls any more ...

@Finomnis
Copy link
Owner

Finomnis commented Jun 16, 2023

The failing lint in the CI isn't your mistake, btw, it seems that clippy added a new check.

@Finomnis
Copy link
Owner

Closed due to inactivity.

@Finomnis Finomnis closed this Jul 19, 2023
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