Skip to content

Commit 84f9e55

Browse files
authored
Merge pull request #904 from rust-embedded/normalize-path
normalize paths
2 parents a2740d2 + cc1bffb commit 84f9e55

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ jobs:
197197
runs-on: windows-latest
198198
suffix: .exe
199199
steps:
200-
- uses: actions/checkout@v3
200+
- uses: actions/checkout@v4
201201

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

215215
- name: Upload artifact
216-
uses: actions/upload-artifact@v3
216+
uses: actions/upload-artifact@v4
217217
with:
218218
name: artifact-svd2rust-${{ matrix.target }}
219219
path: svd2rust-${{ matrix.target }}*

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
if: ${{ matrix.os == 'windows-latest' }}
5353
run: mv target/${{ matrix.target }}/release/svd2rust${{ matrix.suffix }} svd2rust-${{ matrix.target }}${{ matrix.suffix }}
5454

55-
- uses: actions/upload-artifact@v3
55+
- uses: actions/upload-artifact@v4
5656
with:
5757
name: svd2rust-${{ matrix.target }}
5858
path: svd2rust-${{ matrix.target }}${{ matrix.suffix }}
@@ -63,7 +63,7 @@ jobs:
6363
needs: [build]
6464
steps:
6565
- uses: actions/checkout@v4
66-
- uses: actions/download-artifact@v3
66+
- uses: actions/download-artifact@v4
6767
with:
6868
path: artifacts
6969
- run: ls -R ./artifacts
@@ -76,7 +76,7 @@ jobs:
7676
with:
7777
version: ${{ (github.ref_type == 'tag' && github.ref_name) || 'Unreleased' }}
7878

79-
- uses: softprops/action-gh-release@v1
79+
- uses: softprops/action-gh-release@v2
8080
with:
8181
tag_name: ${{ steps.changelog-reader.outputs.version }}
8282
name: ${{ (github.ref_type == 'tag' && steps.changelog-reader.outputs.version) || format('Prereleased {0}', env.CURRENT_DATE) }}

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
## [Unreleased]
99

10+
- Fix reexport path when "%s" inside "derivedFrom"
1011
- Force using rust edition 2021 in CI
1112
- Added lifetime ellision for `FieldWriter` where the explicit lifetimes are not necessary, which
1213
fixes the `clippy::needless_lifetimes` warning on rustc 1.84

src/util.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,18 @@ pub fn block_path_to_ty(
295295
) -> TypePath {
296296
let mut path = config.settings.crate_path.clone().unwrap_or_default().0;
297297
path.segments.push(path_segment(ident(
298-
&bpath.peripheral,
298+
&bpath.peripheral.remove_dim(),
299299
config,
300300
"peripheral_mod",
301301
span,
302302
)));
303303
for ps in &bpath.path {
304-
path.segments
305-
.push(path_segment(ident(ps, config, "cluster_mod", span)));
304+
path.segments.push(path_segment(ident(
305+
&ps.remove_dim(),
306+
config,
307+
"cluster_mod",
308+
span,
309+
)));
306310
}
307311
TypePath { qself: None, path }
308312
}
@@ -314,7 +318,7 @@ pub fn register_path_to_ty(
314318
) -> TypePath {
315319
let mut p = block_path_to_ty(&rpath.block, config, span);
316320
p.path.segments.push(path_segment(ident(
317-
&rpath.name,
321+
&rpath.name.remove_dim(),
318322
config,
319323
"register_mod",
320324
span,

0 commit comments

Comments
 (0)