From 59f7f76166d35e5915804694fac405ff8f9f1733 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Wed, 26 Feb 2025 10:15:42 -0600 Subject: [PATCH] nouveau/class_parser: Make strided element functions const Part-of: --- src/nouveau/headers/struct_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nouveau/headers/struct_parser.py b/src/nouveau/headers/struct_parser.py index ddb08da0d2f..68d3fd06a3c 100644 --- a/src/nouveau/headers/struct_parser.py +++ b/src/nouveau/headers/struct_parser.py @@ -25,7 +25,7 @@ use std::ops::Range; % for f in s.fields: % if f.stride: #[inline] -pub fn ${s.name}_${f.name}(i: usize) -> Range { +pub const fn ${s.name}_${f.name}(i: usize) -> Range { (i * ${f.stride} + ${f.lo})..(i * ${f.stride} + ${f.hi + 1}) } % else: