Skip to content

Commit ebf7204

Browse files
committed
add comment explaining why range syntax is not valid
1 parent 5307407 commit ebf7204

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

svd-rs/src/dimelement.rs

+2
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ impl DimElement {
170170
pub fn indexes_as_range(&self) -> Option<RangeInclusive<u32>> {
171171
let mut integers = Vec::with_capacity(self.dim as usize);
172172
for idx in self.indexes() {
173+
// XXX: indexes that begin with leading zero are not compatible with range (`0-x`) syntax in serialization
174+
// see https://github.com/rust-embedded/svdtools/pull/178#issuecomment-1801433808
173175
let val = idx.parse::<u32>().ok()?;
174176
if val.to_string() != idx {
175177
return None;

0 commit comments

Comments
 (0)