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 up clippy errors from nightly on macos and linux targets #148

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

lopopolo
Copy link
Collaborator

@lopopolo lopopolo commented Feb 2, 2025

no code changes in the unsafe macos bits, just shuffling some comments around to make the linter happy. I've included the additional safety context from #147 (comment).

This should fix the failing builds on main.

@lopopolo lopopolo added Unsafe-Proposed `unsafe` code is added or changed Tier-1 Rust Tier-1 platform labels Feb 2, 2025
@lopopolo lopopolo requested review from astraw and Kijewski February 2, 2025 20:22
@@ -89,7 +89,7 @@ mod openwrt {
}
}

timezone.ok_or_else(|| crate::GetTimezoneError::OsError)
timezone.ok_or(crate::GetTimezoneError::OsError)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

crate::GetTimezoneError::OsError is Copy which is why clippy says the closure is not needed.

@@ -119,8 +122,8 @@ mod string_ref {
length,
};

// SAFETY: `StringRef` is only ever created with a valid `CFStringRef`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

clippy::undocumented_unsafe_blocks wants the SAFETY comment on the block itself, not inside of it.

Copy link
Collaborator

@Kijewski Kijewski left a comment

Choose a reason for hiding this comment

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

Thank you!

@Kijewski Kijewski merged commit dfd189b into main Feb 2, 2025
@lopopolo lopopolo deleted the dev/lopopolo-nightly-clippy-errors branch February 2, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tier-1 Rust Tier-1 platform Unsafe-Proposed `unsafe` code is added or changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants