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

Fix never looping loops #372

Merged
merged 1 commit into from Nov 3, 2023

Conversation

aaronmondal
Copy link
Contributor

@aaronmondal aaronmondal commented Nov 2, 2023

Clippy complained with never_loop, and indeed these loops never loop.


This change is Reviewable

Copy link
Collaborator

@allada allada left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @aaronmondal)


cas/store/tests/filesystem_store_test.rs line 312 at r1 (raw file):

        while let Some(temp_dir_entry) = read_dir_stream.next().await {
            if let Ok(dir_entry) = temp_dir_entry {

I don't think we can do it this way. If temp_dir_entry had an error the test would pass.

I think you can also resolve this by using return Err(make_input_error!("No files should exist in temp directory, found {:?}", ...));

Instead.

Clippy complained with `never_loop`, and indeed these loops never loop.
Copy link
Contributor Author

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @allada)


cas/store/tests/filesystem_store_test.rs line 312 at r1 (raw file):

Previously, allada (Nathan (Blaise) Bruer) wrote…

I don't think we can do it this way. If temp_dir_entry had an error the test would pass.

I think you can also resolve this by using return Err(make_input_error!("No files should exist in temp directory, found {:?}", ...));

Instead.

Updated this. A bit verbose, but a temp_dir_entry? doesn't work.

Copy link
Collaborator

@allada allada left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @aaronmondal)


cas/store/tests/filesystem_store_test.rs line 312 at r1 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

Updated this. A bit verbose, but a temp_dir_entry? doesn't work.

Yeah that is pretty verbose :-(

@aaronmondal aaronmondal merged commit 755c10e into TraceMachina:main Nov 3, 2023
12 of 14 checks passed
aaronmondal added a commit that referenced this pull request Nov 3, 2023
aaronmondal added a commit that referenced this pull request Nov 3, 2023
This reverts commit 755c10e.

This doesn't work.
aaronmondal added a commit that referenced this pull request Nov 3, 2023
This reverts commit 755c10e.

This doesn't work.
blakehatch pushed a commit to blakehatch/nativelink that referenced this pull request Nov 21, 2023
Clippy complained with `never_loop`, and indeed these loops never loop.
blakehatch pushed a commit to blakehatch/nativelink that referenced this pull request Nov 21, 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