Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F131526
matcher.rs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
528 B
Referenced Files
None
Subscribers
None
matcher.rs
View Options
use
fuzzy_matcher
::
skim
::
SkimMatcherV2
;
use
fuzzy_matcher
::
FuzzyMatcher
;
pub
struct
Matcher
{
/// The search pattern that we want to match against some text
pub
pattern
:
String
,
matcher
:
SkimMatcherV2
,
}
impl
Matcher
{
pub
fn
new
(
pattern
:
String
)
->
Self
{
Self
{
pattern
,
matcher
:
SkimMatcherV2
::
default
(),
}
}
pub
fn
score
(
&
self
,
text
:
&
str
)
->
i64
{
self
.
matcher
.
fuzzy_match
(
text
,
&
self
.
pattern
)
.
unwrap_or_default
()
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Apr 6 2026, 5:59 PM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10576
Default Alt Text
matcher.rs (528 B)
Attached To
Mode
R1 ivy.nvim
Attached
Detach File
Event Timeline
Log In to Comment