[pdm-devel] [PATCH proxmox v2 01/14] api-macro: allow $ in identifier name

Christoph Heiss c.heiss at proxmox.com
Fri Dec 5 12:25:03 CET 2025


This allows dollar-sign in renamed field names for API types.

Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
Changes v1 -> v2:
  * no changes

 proxmox-api-macro/src/util.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxmox-api-macro/src/util.rs b/proxmox-api-macro/src/util.rs
index 9ed3fa0b..20a4d53b 100644
--- a/proxmox-api-macro/src/util.rs
+++ b/proxmox-api-macro/src/util.rs
@@ -30,7 +30,7 @@ pub struct FieldName {
 
 impl FieldName {
     pub fn new(name: String, span: Span) -> Self {
-        let mut ident_str = name.replace(['-', '.', '+'].as_ref(), "_");
+        let mut ident_str = name.replace(['-', '.', '+', '$'].as_ref(), "_");
 
         if ident_str.chars().next().unwrap().is_numeric() {
             ident_str.insert(0, '_');
-- 
2.51.2





More information about the pdm-devel mailing list