From e58dd75c0f9e6a696fc03e912496c7b2683f745c Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Sun, 23 Mar 2025 00:32:52 -0500 Subject: [PATCH] nouveau/headers: Drop double-underscore from Rust names There are a couple of these in thea headers and they cause Rust to throw warnings. Just fix them instead of disabling the Rust warning. Part-of: --- src/nouveau/headers/class_parser.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/nouveau/headers/class_parser.py b/src/nouveau/headers/class_parser.py index 64b3c9b7712..e4279b379ce 100644 --- a/src/nouveau/headers/class_parser.py +++ b/src/nouveau/headers/class_parser.py @@ -369,7 +369,7 @@ class Field(object): elif name[0].isdigit(): return '_' + name else: - return name + return re.sub(r'_+', '_', name) class Method(object): def __init__(self, name, addr, is_array=False): @@ -520,7 +520,6 @@ def main(): f.write(TEMPLATE_RS.render(**environment)) if args.out_rs_mthd is not None: with open(args.out_rs_mthd, 'w', encoding='utf-8') as f: - f.write("#![allow(non_snake_case)]\n") f.write("use crate::Mthd;\n") f.write("use crate::ArrayMthd;\n") f.write("\n")