29 lines
594 B
Rust
29 lines
594 B
Rust
use sublime_fuzzy::{best_match, Match};
|
|
|
|
fn _test_fuzz() {
|
|
let y = vec!["hi", "Hullo"];
|
|
for targets in y {
|
|
let res = fuzzy_match("hi".to_string(), targets.to_string());
|
|
|
|
match res {
|
|
Some(mat) => {
|
|
println!("{:?}", mat)
|
|
}
|
|
None => {
|
|
println!("ok")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
fn fuzzy_match(query: String, target: String) -> Option<Match> {
|
|
best_match(&query, &target)
|
|
}
|
|
|
|
pub struct ASearch;
|
|
|
|
impl ASearch {
|
|
fn _sort_by_size() {}
|
|
fn _sort_by_alphanumeric() {}
|
|
fn _sort_by_tree() {}
|
|
}
|