Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- move `must_use` from methods to generic type

## [v0.33.5] - 2024-10-12

- Fix STM32-patched CI
Expand Down
2 changes: 2 additions & 0 deletions src/generate/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ pub mod raw {
}
}

#[must_use = "after creating `FieldWriter` you need to call field value setting method"]
pub struct FieldWriter<'a, REG, const WI: u8, FI = u8, Safety = Unsafe>
where
REG: Writable + RegisterSpec,
Expand Down Expand Up @@ -174,6 +175,7 @@ pub mod raw {
}
}

#[must_use = "after creating `BitWriter` you need to call bit setting method"]
pub struct BitWriter<'a, REG, FI = bool, M = BitM>
where
REG: Writable + RegisterSpec,
Expand Down
3 changes: 0 additions & 3 deletions src/generate/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,6 @@ pub fn fields(
#[doc = ""]
#[doc = #note]
#inline
#[must_use]
pub fn #name_snake_case(&mut self, n: u8) -> #writer_ty<#regspec_ty> {
#[allow(clippy::no_effect)]
[(); #dim][n as usize];
Expand All @@ -1326,7 +1325,6 @@ pub fn fields(
w_impl_items.extend(quote! {
#[doc = #doc]
#inline
#[must_use]
pub fn #name_snake_case_n(&mut self) -> #writer_ty<#regspec_ty> {
#writer_ty::new(self, #sub_offset)
}
Expand All @@ -1338,7 +1336,6 @@ pub fn fields(
w_impl_items.extend(quote! {
#[doc = #doc]
#inline
#[must_use]
pub fn #name_snake_case(&mut self) -> #writer_ty<#regspec_ty> {
#writer_ty::new(self, #offset)
}
Expand Down
Loading