From 6ced433429bdc05691169ae9c200ecc9b31bd688 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Wed, 1 Nov 2023 11:45:00 +0300 Subject: [PATCH] rename const-generic to array_proxy --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 2 ++ ci/script.sh | 2 +- src/generate/device.rs | 4 ++-- src/generate/peripheral.rs | 4 ++-- src/main.rs | 6 +++--- src/util.rs | 4 ++-- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7aadf889..8d0ada18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: - { rust: stable, vendor: Spansion, options: "--atomics" } - { rust: stable, vendor: STMicro, options: "" } - { rust: stable, vendor: STMicro, options: "--atomics" } - - { rust: stable, vendor: STM32-patched, options: "--strict --const_generic --pascal_enum_values --max_cluster_size --atomics --atomics_feature atomics" } + - { rust: stable, vendor: STM32-patched, options: "--strict --array_proxy --pascal_enum_values --max_cluster_size --atomics --atomics_feature atomics" } - { rust: stable, vendor: Toshiba, options: all } - { rust: stable, vendor: Toshiba, options: "" } # Test MSRV diff --git a/CHANGELOG.md b/CHANGELOG.md index 2137235d..6f29b9db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- rename `const-generic` feature to `array_proxy` + ## [v0.30.3] - 2023-11-19 - Remove unstable lints diff --git a/ci/script.sh b/ci/script.sh index 707a497b..3ec8a3ae 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -31,7 +31,7 @@ main() { case $OPTIONS in all) - options="--const_generic --strict --atomics" + options="--array_proxy --strict --atomics" ;; *) options=$OPTIONS diff --git a/src/generate/device.rs b/src/generate/device.rs index 19818066..1c7bd1dd 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -157,7 +157,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result Result Result Result<()> { .value_name("FEATURE"), ) .arg( - Arg::new("const_generic") - .long("const_generic") + Arg::new("array_proxy") + .long("array_proxy") .action(ArgAction::SetTrue) .help( - "Use const generics to generate writers for same fields with different offsets", + "Use ArrayProxy helper for non-sequential register arrays", ), ) .arg( diff --git a/src/util.rs b/src/util.rs index b6e62ccd..4ccb6f4c 100644 --- a/src/util.rs +++ b/src/util.rs @@ -36,7 +36,7 @@ pub struct Config { #[cfg_attr(feature = "serde", serde(default))] pub make_mod: bool, #[cfg_attr(feature = "serde", serde(default))] - pub const_generic: bool, + pub array_proxy: bool, #[cfg_attr(feature = "serde", serde(default))] pub ignore_groups: bool, #[cfg_attr(feature = "serde", serde(default))] @@ -114,7 +114,7 @@ impl Default for Config { atomics_feature: None, generic_mod: false, make_mod: false, - const_generic: false, + array_proxy: false, ignore_groups: false, keep_list: false, strict: false,