Skip to content

Commit

Permalink
Do not derive DimElement
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull committed Jan 22, 2025
1 parent 909a68b commit ef4277a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion svd-rs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

- Do not derive `DimElement`
- Revert the `riscv` elements, as well as the `unstable-riscv` feature.

## [v0.14.9] - 2024-08-20
Expand Down Expand Up @@ -143,4 +144,3 @@ Previous versions in common [changelog](../CHANGELOG.md).
[v0.11.2]: https://github.com/rust-embedded/svd/compare/svd-rs-v0.11.1...svd-rs-v0.11.2
[v0.11.1]: https://github.com/rust-embedded/svd/compare/v0.11.0...svd-rs-v0.11.1
[v0.11.0]: https://github.com/rust-embedded/svd/compare/v0.10.2...v0.11.0

10 changes: 2 additions & 8 deletions svd-rs/src/derive_from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,10 @@ where
{
fn derive_from(&self, other: &Self) -> Self {
match (self, other) {
(Self::Single(info), Self::Single(other_info)) => {
(Self::Single(info), Self::Single(other_info) | Self::Array(other_info, _)) => {
Self::Single(info.derive_from(other_info))
}
(Self::Single(info), Self::Array(other_info, other_dim)) => {
let mut dim = other_dim.clone();
dim.dim_name = None;
Self::Array(info.derive_from(other_info), dim)
}
(Self::Array(info, dim), Self::Single(other_info))
| (Self::Array(info, dim), Self::Array(other_info, _)) => {
(Self::Array(info, dim), Self::Single(other_info) | Self::Array(other_info, _)) => {
Self::Array(info.derive_from(other_info), dim.clone())
}
}
Expand Down

0 comments on commit ef4277a

Please sign in to comment.