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

Rustdoc clippy and typo fixes #512

Merged
merged 4 commits into from
Oct 7, 2024
Merged

Conversation

sourcebox
Copy link
Contributor

Various documentation fixes for warnings shown by running cargo clippy and typos.

@sourcebox
Copy link
Contributor Author

Changelog already contains an entry about clippy fixes.

Dirbaio
Dirbaio previously approved these changes Oct 7, 2024
@Dirbaio
Copy link
Member

Dirbaio commented Oct 7, 2024

lgtm but there's still more clippy failures, could you fix those?

@sourcebox
Copy link
Contributor Author

lgtm but there's still more clippy failures, could you fix those?

There are 2 lints "a const item should not be interior mutable":

const EMPTY_CELL: Cell<T> = Cell::new(0);
const INIT: UnsafeCell<MaybeUninit<T>> = UnsafeCell::new(MaybeUninit::uninit());

I'm not sure what to do here without breaking something.

@sourcebox
Copy link
Contributor Author

Clippy docs just suggest to replace const with static.

@sourcebox
Copy link
Contributor Author

Clippy docs just suggest to replace const with static.

But that doesn't compile, so it's not even an option.

@Dirbaio
Copy link
Member

Dirbaio commented Oct 7, 2024

you can remove the const, and do buffer: [const { UnsafeCell::new(MaybeUninit::uninit()) }; N]. this is inline const block, stabilized in 1.79.

@sourcebox
Copy link
Contributor Author

you can remove the const, and do buffer: [const { UnsafeCell::new(MaybeUninit::uninit()) }; N]. this is inline const block, stabilized in 1.79.

Thanks. Done.

@sourcebox
Copy link
Contributor Author

Checks are finally all passed.

Copy link
Member

@Dirbaio Dirbaio left a comment

Choose a reason for hiding this comment

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

thanks!

@Dirbaio Dirbaio added this pull request to the merge queue Oct 7, 2024
Merged via the queue into rust-embedded:main with commit 8ab2335 Oct 7, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants