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 clippy lint 'suspicious_open_options' #5862

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

MarkusPettersson98
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 commented Feb 26, 2024

This PR fixes clippy lint suspicious_open_options added in 1.75.

truncate(false) is supposedly the default behavior, but maybe we want to change this to true. Thoughts?


This change is Reviewable

Copy link
Member

@dlon dlon left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @MarkusPettersson98)


mullvad-exclude/src/main.rs line 98 at r1 (raw file):

        .write(true)
        .create(true)
        .truncate(false)

This is likely correct.


talpid-core/src/split_tunnel/linux.rs line 117 at r1 (raw file):

            .write(true)
            .create(true)
            .truncate(false)

This is likely correct.


talpid-core/src/split_tunnel/linux.rs line 177 at r1 (raw file):

            .write(true)
            .create(true)
            .truncate(false)

This is likely correct.


test/test-runner/src/sys.rs line 181 at r1 (raw file):

    let mut file = tokio::fs::OpenOptions::new()
        .create(true)
        .truncate(false)

Truncating seems correct here, right? We want to wipe all existing overrides.


test/test-runner/src/sys.rs line 413 at r1 (raw file):

    let mut file = tokio::fs::OpenOptions::new()
        .create(true)
        .truncate(false)

Ditto.

Copy link
Contributor Author

@MarkusPettersson98 MarkusPettersson98 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: all files reviewed, 2 unresolved discussions (waiting on @dlon)


test/test-runner/src/sys.rs line 181 at r1 (raw file):

Previously, dlon (David Lönnhager) wrote…

Truncating seems correct here, right? We want to wipe all existing overrides.

Yes, we do. So we should truncate :)


test/test-runner/src/sys.rs line 413 at r1 (raw file):

Previously, dlon (David Lönnhager) wrote…

Ditto.

Yes, we do. So we should truncate :)

@MarkusPettersson98 MarkusPettersson98 force-pushed the fix/clippy-nightly branch 2 times, most recently from ac0032c to c3b9c57 Compare February 27, 2024 09:07
Copy link
Member

@dlon dlon 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

@MarkusPettersson98 MarkusPettersson98 merged commit 9223ccf into main Feb 27, 2024
37 of 38 checks passed
@MarkusPettersson98 MarkusPettersson98 deleted the fix/clippy-nightly branch February 27, 2024 12:01
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