Skip to content

Remove trait and result arguments from macros#94

Merged
robin-nitrokey merged 1 commit intomainfrom
macro-hygiene
Feb 28, 2025
Merged

Remove trait and result arguments from macros#94
robin-nitrokey merged 1 commit intomainfrom
macro-hygiene

Conversation

@robin-nitrokey
Copy link
Member

The const_ram_storage! and ram_storage! macros used to have trait and result arguments to set the storage trait to implement and the result type to use. As this defaulted to relative paths, it made the result of the macro dependent on the context and could cause confusion. At the same time, there is no real use case for substituting these types.

This patch removes the arguments for good and just uses $crate::driver::Storage and $crate::io::Result instead.


As we prepare a breaking release, I’d like to pull in this change that fixes a very annoying macro hygiene issue.

The const_ram_storage! and ram_storage! macros used to have trait and
result arguments to set the storage trait to implement and the result
type to use.  As this defaulted to relative paths, it made the result of
the macro dependent on the context and could cause confusion.  At the
same time, there is no real use case for substituting these types.

This patch removes the arguments for good and just uses
$crate::driver::Storage and $crate::io::Result instead.
@robin-nitrokey robin-nitrokey merged commit 9fdeadc into main Feb 28, 2025
10 checks passed
@robin-nitrokey robin-nitrokey deleted the macro-hygiene branch February 28, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants