Skip to content

Commit 2aa5c9f

Browse files
readied
1 parent bc477fa commit 2aa5c9f

File tree

1 file changed

+4
-5
lines changed
  • crates/pgt_treesitter/src/context

1 file changed

+4
-5
lines changed

crates/pgt_treesitter/src/context/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ pub enum WrappingNode {
5757
List,
5858
}
5959

60-
6160
impl TryFrom<&str> for WrappingNode {
6261
type Error = String;
6362

@@ -646,9 +645,10 @@ impl<'a> TreesitterContext<'a> {
646645
/// If the tree shows `relation > object_reference > identifier` and the "identifier" is a leaf node,
647646
/// you need to pass `&["relation", "object_reference"]`.
648647
pub fn matches_one_of_ancestors(&self, expected_ancestors: &[&'static str]) -> bool {
649-
self.node_under_cursor
650-
.as_ref()
651-
.is_some_and(|node| node.parent().is_some_and(|p| expected_ancestors.contains(&p.kind())))
648+
self.node_under_cursor.as_ref().is_some_and(|node| {
649+
node.parent()
650+
.is_some_and(|p| expected_ancestors.contains(&p.kind()))
651+
})
652652
}
653653

654654
/// Checks whether the Node under the cursor is the nth child of the parent.
@@ -787,7 +787,6 @@ mod tests {
787787

788788
use pgt_test_utils::QueryWithCursorPosition;
789789

790-
791790
fn get_tree(input: &str) -> tree_sitter::Tree {
792791
let mut parser = tree_sitter::Parser::new();
793792
parser

0 commit comments

Comments
 (0)