mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-25 01:03:46 +01:00
s/Lazy<GlobMatcher>/Lazy<Option<GlobMatcher>>/
This commit is contained in:
parent
cfd622d6e1
commit
4ad3002543
@ -41,7 +41,7 @@ impl MappingTarget {
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, DeserializeFromStr)]
|
||||
/// A single matcher.
|
||||
///
|
||||
/// Codegen converts this into a `Lazy<GlobMatcher>`.
|
||||
/// Codegen converts this into a `Lazy<Option<GlobMatcher>>`.
|
||||
struct Matcher(Vec<MatcherSegment>);
|
||||
/// Parse a matcher.
|
||||
///
|
||||
|
@ -52,7 +52,7 @@ include!(concat!(
|
||||
///
|
||||
/// A failure to compile is a fatal error.
|
||||
///
|
||||
/// Used internally by `Lazy<GlobMatcher>`'s lazy evaluation closure.
|
||||
/// Used internally by `Lazy<Option<GlobMatcher>>`'s lazy evaluation closure.
|
||||
fn build_matcher_fixed(from: &str) -> GlobMatcher {
|
||||
make_glob_matcher(from).expect("A builtin fixed glob matcher failed to compile")
|
||||
}
|
||||
@ -63,7 +63,7 @@ fn build_matcher_fixed(from: &str) -> GlobMatcher {
|
||||
/// Returns `None` if any replacement fails, or if the joined glob string fails
|
||||
/// to compile.
|
||||
///
|
||||
/// Used internally by `Lazy<GlobMatcher>`'s lazy evaluation closure.
|
||||
/// Used internally by `Lazy<Option<GlobMatcher>>`'s lazy evaluation closure.
|
||||
fn build_matcher_dynamic(segs: &[MatcherSegment]) -> Option<GlobMatcher> {
|
||||
// join segments
|
||||
let mut buf = String::new();
|
||||
@ -83,7 +83,7 @@ fn build_matcher_dynamic(segs: &[MatcherSegment]) -> Option<GlobMatcher> {
|
||||
|
||||
/// A segment of a dynamic builtin matcher.
|
||||
///
|
||||
/// Used internally by `Lazy<GlobMatcher>`'s lazy evaluation closure.
|
||||
/// Used internally by `Lazy<Option<GlobMatcher>>`'s lazy evaluation closure.
|
||||
#[derive(Clone, Debug)]
|
||||
enum MatcherSegment {
|
||||
Text(&'static str),
|
||||
|
Loading…
Reference in New Issue
Block a user