Skip to content

Rustdoc clippy and typo fixes#512

Merged
Dirbaio merged 4 commits into
rust-embedded:mainfrom
sourcebox:doc-fixes
Oct 7, 2024
Merged

Rustdoc clippy and typo fixes#512
Dirbaio merged 4 commits into
rust-embedded:mainfrom
sourcebox:doc-fixes

Conversation

@sourcebox

Copy link
Copy Markdown
Contributor

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

@sourcebox

Copy link
Copy Markdown
Contributor Author

Changelog already contains an entry about clippy fixes.

Dirbaio
Dirbaio previously approved these changes Oct 7, 2024
@Dirbaio

Dirbaio commented Oct 7, 2024

Copy link
Copy Markdown
Member

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

@sourcebox

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Clippy docs just suggest to replace const with static.

@sourcebox

Copy link
Copy Markdown
Contributor Author

Clippy docs just suggest to replace const with static.

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

@Dirbaio

Dirbaio commented Oct 7, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Contributor Author

Checks are finally all passed.

@Dirbaio Dirbaio left a comment

Copy link
Copy Markdown
Member

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
@sourcebox sourcebox deleted the doc-fixes branch May 2, 2025 23:40
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