[Feature request] add is_literal(pattern)
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 595
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
It would be really helpful to have a function that tells you whether the input pattern contains any globs.
Basically a version of this that ignores escaped characters:
const GLOB_CHARS: [char; 3] = ['?', '*', '['];
pub fn is_literal(pattern: &str) -> bool {
// Need to check the characters aren't escaped here.
!pattern.chars().any(|c| GLOB_CHARS.contains(&c))
}
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Review the existing public API and pattern-escaping behavior before adding the requested is_literal(pattern) helper. Confirm how escaped glob characters are treated and add coverage for literal, unescaped-glob, and escaped-glob patterns; done means the helper reliably distinguishes them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100