Skip to content

Commit 019ddae

Browse files
committed
add check for field name
1 parent 917cfff commit 019ddae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/generate/register.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,12 @@ pub fn fields(
281281
let suffixes_str = format!("({}-{})", first, first + de.dim - 1);
282282
Some((first, de.dim, de.dim_increment, suffixes, suffixes_str))
283283
}
284-
Field::Single(_) => None,
284+
Field::Single(_) => {
285+
if f.name.contains("%s") {
286+
return Err(format!("incorrect field {}", f.name))?;
287+
}
288+
None
289+
}
285290
};
286291

287292
if can_read {

0 commit comments

Comments
 (0)