We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f8c6d3 commit accbd26Copy full SHA for accbd26
dsc_lib/src/parser/expressions.rs
@@ -131,11 +131,8 @@ impl Expression {
131
},
132
Accessor::Index(index) => {
133
if let Some(array) = value.as_array() {
134
- if !index.is_number() {
135
- return Err(DscError::Parser("Index is not a number".to_string()));
136
- }
137
let Some(index) = index.as_u64() else {
138
+ return Err(DscError::Parser("Index is not a valid number".to_string()));
139
};
140
let index = usize::try_from(index)?;
141
if index >= array.len() {
0 commit comments