Skip to content

Commit 4b43f12

Browse files
committed
Merge branch 'add-sshdconfig-tracing' of https://github.com/tgauth/dsc into add-sshdconfig-tracing
2 parents f4350f0 + a1b9975 commit 4b43f12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sshdconfig/src/parser.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,12 @@ fn parse_arguments_node(arg_node: tree_sitter::Node, input: &str, input_bytes: &
145145
let mut value = Value::Null;
146146

147147
// if there is more than one argument, but a vector is not expected for the keyword, throw an error
148-
if arg_node.named_children(&mut cursor).count() > 1 && !is_vec {
148+
let children: Vec<_> = arg_node.named_children(&mut cursor).collect();
149+
if children.len() > 1 && !is_vec {
149150
return Err(SshdConfigError::ParserError(t!("parser.invalidMultiArgNode", input = input).to_string()));
150151
}
151152

152-
for node in arg_node.named_children(&mut cursor) {
153+
for node in children {
153154
if node.is_error() {
154155
return Err(SshdConfigError::ParserError(t!("parser.failedToParseChildNode", input = input).to_string()));
155156
}

0 commit comments

Comments
 (0)