The best possible diff would require matching a node with part of a string constant

Before

…lines 1–68 unchanged (68 lines)
69
70 pub fn run<C>(&self, query: &str, item_pool: Arc<DeferDrop<ItemPool>>, callback: C) -> MatcherControl
71 where
72 C: Fn(Arc<SpinLock<Vec<MatchedItem>>>) + Send + 'static,
73 {
74 let matcher_engine = self.engine_factory.create_engine_with_case(query, self.case_matching);
75 debug!("engine: {}", matcher_engine);
76 let stopped = Arc::new(AtomicBool::new(false));
77 let stopped_clone = stopped.clone();
78 let processed = Arc::new(AtomicUsize::new(0));
79 let processed_clone = processed.clone();
80 let matched = Arc::new(AtomicUsize::new(0));
81 let matched_clone = matched.clone();
…lines 82–135 unchanged (54 lines)

After

…lines 1–68 unchanged (68 lines)
69
70 pub fn run<C>(&self, query: &str, item_pool: Arc<DeferDrop<ItemPool>>, callback: C) -> MatcherControl
71 where
72 C: Fn(Arc<SpinLock<Vec<MatchedItem>>>) + Send + 'static,
73 {
74 let matcher_engine = self.engine_factory.create_engine_with_case(query, self.case_matching);
75 debug!("engine: {matcher_engine}");
76 let stopped = Arc::new(AtomicBool::new(false));
77 let stopped_clone = stopped.clone();
78 let processed = Arc::new(AtomicUsize::new(0));
79 let processed_clone = processed.clone();
80 let matched = Arc::new(AtomicUsize::new(0));
81 let matched_clone = matched.clone();
…lines 82–135 unchanged (54 lines)

Before

source_file
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "sync"
:: "::"
identifier "Arc"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "sync"
:: "::"
identifier "atomic"
:: "::"
use_list
{ "{"
identifier "AtomicBool"
, ","
identifier "AtomicUsize"
, ","
identifier "Ordering"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "std"
:: "::"
identifier "thread"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "thread"
:: "::"
identifier "JoinHandle"
; ";"
use_declaration
use "use"
use_wildcard
scoped_identifier
identifier "rayon"
:: "::"
identifier "prelude"
:: "::"
* "*"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "item"
:: "::"
use_list
{ "{"
identifier "ItemPool"
, ","
identifier "MatchedItem"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "spinlock"
:: "::"
identifier "SpinLock"
; ";"
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
identifier "CaseMatching"
, ","
identifier "MatchEngineFactory"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "defer_drop"
:: "::"
identifier "DeferDrop"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "rc"
:: "::"
identifier "Rc"
; ";"
line_comment
// "//"
struct_item (+70 nodes collapsed)
impl_item (+205 nodes collapsed)
line_comment
// "//"
struct_item (+25 nodes collapsed)
impl_item
impl "impl"
type_identifier "Matcher"
declaration_list
{ "{"
function_item (+44 nodes collapsed)
function_item (+31 nodes collapsed)
function_item
visibility_modifier
pub "pub"
fn "fn"
identifier "build"
parameters
( "("
self_parameter
self "self"
) ")"
-> "->"
type_identifier "Self"
block
{ "{"
self "self"
} "}"
function_item
visibility_modifier
pub "pub"
fn "fn"
identifier "run"
type_parameters
< "<"
type_parameter
type_identifier "C"
> ">"
parameters (+33 nodes collapsed)
-> "->"
type_identifier "MatcherControl"
where_clause (+34 nodes collapsed)
block
{ "{"
let_declaration (+22 nodes collapsed)
expression_statement
macro_invocation
identifier "debug"
! "!"
token_tree
( "("
string_literal
" "\""
string_content "engine: {}"
" "\""
, ","
identifier "matcher_engine"
) ")"
; ";"
let_declaration (+23 nodes collapsed)
let_declaration
let "let"
identifier "stopped_clone"
= "="
call_expression
field_expression
identifier "stopped"
. "."
field_identifier "clone"
arguments
( "("
) ")"
; ";"
let_declaration (+22 nodes collapsed)
let_declaration
let "let"
identifier "processed_clone"
= "="
call_expression
field_expression
identifier "processed"
. "."
field_identifier "clone"
arguments
( "("
) ")"
; ";"
let_declaration (+22 nodes collapsed)
let_declaration
let "let"
identifier "matched_clone"
= "="
call_expression
field_expression
identifier "matched"
. "."
field_identifier "clone"
arguments
( "("
) ")"
; ";"
let_declaration (+29 nodes collapsed)
let_declaration
let "let"
identifier "matched_items_clone"
= "="
call_expression
field_expression
identifier "matched_items"
. "."
field_identifier "clone"
arguments
( "("
) ")"
; ";"
let_declaration (+391 nodes collapsed)
struct_expression (+28 nodes collapsed)
} "}"
} "}"

After

source_file
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "sync"
:: "::"
identifier "Arc"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "sync"
:: "::"
identifier "atomic"
:: "::"
use_list
{ "{"
identifier "AtomicBool"
, ","
identifier "AtomicUsize"
, ","
identifier "Ordering"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "std"
:: "::"
identifier "thread"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "thread"
:: "::"
identifier "JoinHandle"
; ";"
use_declaration
use "use"
use_wildcard
scoped_identifier
identifier "rayon"
:: "::"
identifier "prelude"
:: "::"
* "*"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
crate "crate"
:: "::"
identifier "item"
:: "::"
use_list
{ "{"
identifier "ItemPool"
, ","
identifier "MatchedItem"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "spinlock"
:: "::"
identifier "SpinLock"
; ";"
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
identifier "CaseMatching"
, ","
identifier "MatchEngineFactory"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "defer_drop"
:: "::"
identifier "DeferDrop"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "rc"
:: "::"
identifier "Rc"
; ";"
line_comment
// "//"
struct_item (+70 nodes collapsed)
impl_item (+205 nodes collapsed)
line_comment
// "//"
struct_item (+25 nodes collapsed)
impl_item
impl "impl"
type_identifier "Matcher"
declaration_list
{ "{"
function_item (+44 nodes collapsed)
function_item (+31 nodes collapsed)
function_item
visibility_modifier
pub "pub"
fn "fn"
identifier "build"
parameters
( "("
self_parameter
self "self"
) ")"
-> "->"
type_identifier "Self"
block
{ "{"
self "self"
} "}"
function_item
visibility_modifier
pub "pub"
fn "fn"
identifier "run"
type_parameters
< "<"
type_parameter
type_identifier "C"
> ">"
parameters (+33 nodes collapsed)
-> "->"
type_identifier "MatcherControl"
where_clause (+34 nodes collapsed)
block
{ "{"
let_declaration (+22 nodes collapsed)
expression_statement
macro_invocation
identifier "debug"
! "!"
token_tree
( "("
string_literal
" "\""
string_content "engine: {matcher_engine}"
" "\""
) ")"
; ";"
let_declaration (+23 nodes collapsed)
let_declaration
let "let"
identifier "stopped_clone"
= "="
call_expression
field_expression
identifier "stopped"
. "."
field_identifier "clone"
arguments
( "("
) ")"
; ";"
let_declaration (+22 nodes collapsed)
let_declaration
let "let"
identifier "processed_clone"
= "="
call_expression
field_expression
identifier "processed"
. "."
field_identifier "clone"
arguments
( "("
) ")"
; ";"
let_declaration (+22 nodes collapsed)
let_declaration
let "let"
identifier "matched_clone"
= "="
call_expression
field_expression
identifier "matched"
. "."
field_identifier "clone"
arguments
( "("
) ")"
; ";"
let_declaration (+29 nodes collapsed)
let_declaration
let "let"
identifier "matched_items_clone"
= "="
call_expression
field_expression
identifier "matched_items"
. "."
field_identifier "clone"
arguments
( "("
) ")"
; ";"
let_declaration (+391 nodes collapsed)
struct_expression (+28 nodes collapsed)
} "}"
} "}"