Skip to content

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

2 participants