Skip to content

Commit

Permalink
Merge pull request #904 from rust-embedded/normalize-path
Browse files Browse the repository at this point in the history
normalize paths
  • Loading branch information
Emilgardis authored Feb 4, 2025
2 parents a2740d2 + cc1bffb commit 84f9e55
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:
runs-on: windows-latest
suffix: .exe
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
with:
Expand All @@ -213,7 +213,7 @@ jobs:
- run: mv target/${{ matrix.target }}/release/svd2rust${{ matrix.suffix || '' }} svd2rust-${{ matrix.target }}-$(git rev-parse --short HEAD)${{ matrix.suffix || '' }}

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-svd2rust-${{ matrix.target }}
path: svd2rust-${{ matrix.target }}*
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
if: ${{ matrix.os == 'windows-latest' }}
run: mv target/${{ matrix.target }}/release/svd2rust${{ matrix.suffix }} svd2rust-${{ matrix.target }}${{ matrix.suffix }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: svd2rust-${{ matrix.target }}
path: svd2rust-${{ matrix.target }}${{ matrix.suffix }}
Expand All @@ -63,7 +63,7 @@ jobs:
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: artifacts
- run: ls -R ./artifacts
Expand All @@ -76,7 +76,7 @@ jobs:
with:
version: ${{ (github.ref_type == 'tag' && github.ref_name) || 'Unreleased' }}

- uses: softprops/action-gh-release@v1
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.changelog-reader.outputs.version }}
name: ${{ (github.ref_type == 'tag' && steps.changelog-reader.outputs.version) || format('Prereleased {0}', env.CURRENT_DATE) }}
Expand Down
1 change: 1 addition & 0 deletions 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](https://semver.org/).

## [Unreleased]

- Fix reexport path when "%s" inside "derivedFrom"
- Force using rust edition 2021 in CI
- Added lifetime ellision for `FieldWriter` where the explicit lifetimes are not necessary, which
fixes the `clippy::needless_lifetimes` warning on rustc 1.84
Expand Down
12 changes: 8 additions & 4 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,18 @@ pub fn block_path_to_ty(
) -> TypePath {
let mut path = config.settings.crate_path.clone().unwrap_or_default().0;
path.segments.push(path_segment(ident(
&bpath.peripheral,
&bpath.peripheral.remove_dim(),
config,
"peripheral_mod",
span,
)));
for ps in &bpath.path {
path.segments
.push(path_segment(ident(ps, config, "cluster_mod", span)));
path.segments.push(path_segment(ident(
&ps.remove_dim(),
config,
"cluster_mod",
span,
)));
}
TypePath { qself: None, path }
}
Expand All @@ -314,7 +318,7 @@ pub fn register_path_to_ty(
) -> TypePath {
let mut p = block_path_to_ty(&rpath.block, config, span);
p.path.segments.push(path_segment(ident(
&rpath.name,
&rpath.name.remove_dim(),
config,
"register_mod",
span,
Expand Down

0 comments on commit 84f9e55

Please sign in to comment.