Skip to content

Commit f4cfb56

Browse files
committed
Move Yeast helper before test module
Fixes the clippy::items_after_test_module lint error reported by Clippy 1.98. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aaf47101-2cb9-4d38-9f6a-e492c4da4135
1 parent cd9a248 commit f4cfb56

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

‎shared/yeast/src/dump.rs‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,20 @@ fn source_skeleton(ast: &Ast, node: &Node, source: &str) -> SourceSkeleton {
522522
SourceSkeleton::Text(result)
523523
}
524524

525+
fn node_content(node: &Node, source: &str) -> String {
526+
match &node.content {
527+
NodeContent::DynamicString(s) if !s.is_empty() => s.clone(),
528+
_ => {
529+
let range = node.byte_range();
530+
if range.start < source.len() && range.end <= source.len() {
531+
source[range.start..range.end].to_string()
532+
} else {
533+
String::new()
534+
}
535+
}
536+
}
537+
}
538+
525539
#[cfg(test)]
526540
mod tests {
527541
use super::*;
@@ -675,17 +689,3 @@ mod tests {
675689
.starts_with("parent source=<invalid: child range 7..9 is outside node range 0..6>\n"));
676690
}
677691
}
678-
679-
fn node_content(node: &Node, source: &str) -> String {
680-
match &node.content {
681-
NodeContent::DynamicString(s) if !s.is_empty() => s.clone(),
682-
_ => {
683-
let range = node.byte_range();
684-
if range.start < source.len() && range.end <= source.len() {
685-
source[range.start..range.end].to_string()
686-
} else {
687-
String::new()
688-
}
689-
}
690-
}
691-
}

0 commit comments

Comments
 (0)