Make PatternToken public
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by locating the PatternToken definition and the Pattern parsing entry points, then read how token visibility currently limits inspection. Make PatternToken publicly accessible so callers can inspect parsed pattern elements without reimplementing parsing, and verify the examples in the issue can use the public API.
Written by the indexing model from the issue text.
Description
glob provides nice parsing and matching facilities, and sometimes it's important to reach into the Pattern and inspect the individual PatternToken elements themselves.
Use case
Given some fn extend_with_literals(input: &str, pattern: Pattern), identify whether the input is a valid prefix of pattern and determine any subsequent literal characters from the pattern that would better qualify the input.
Example
assert_eq!(
extend_with_literals("pr", Pattern::new("pr[e]?ix").unwrap()),
"pre"
);
assert_eq!(
extend_with_literals("pre", Pattern::new("pr[e]?ix").unwrap()),
"pre"
);
assert_eq!(
extend_with_literals("pref", Pattern::new("pr[e]?ix").unwrap()),
"prefix"
);
This makes it possible to optimize glob in over a nonstandard async filesystem where enumeration is very expensive and irrelevant matches are common.
It's easier to implement this by having access to the PatternToken and not needing to reimplement AnyWithin/AnyExcept parsing.
- Dominant language
- Rust
- Stars
- 597
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/glob
-
[1.0] Change `MatchOptions::default` to match `MatchOptions::new`Possibly taken @Dym03 claimed this 380 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
good first issue help wanted program
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
hffgzktbcc-blip/ounce-core#297 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nautechsystems/nautilus_trader#5631 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
bytecodealliance/rustix#1736 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
longbridge/gpui-kit#3871 ·
Maintainers usually reply within 1 day
-
area:models enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day