mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-24 16:53:55 +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)]
|
#[derive(Clone, Debug, PartialEq, Eq, Hash, DeserializeFromStr)]
|
||||||
/// A single matcher.
|
/// A single matcher.
|
||||||
///
|
///
|
||||||
/// Codegen converts this into a `Lazy<GlobMatcher>`.
|
/// Codegen converts this into a `Lazy<Option<GlobMatcher>>`.
|
||||||
struct Matcher(Vec<MatcherSegment>);
|
struct Matcher(Vec<MatcherSegment>);
|
||||||
/// Parse a matcher.
|
/// Parse a matcher.
|
||||||
///
|
///
|
||||||
|
@ -52,7 +52,7 @@ include!(concat!(
|
|||||||
///
|
///
|
||||||
/// A failure to compile is a fatal error.
|
/// 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 {
|
fn build_matcher_fixed(from: &str) -> GlobMatcher {
|
||||||
make_glob_matcher(from).expect("A builtin fixed glob matcher failed to compile")
|
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
|
/// Returns `None` if any replacement fails, or if the joined glob string fails
|
||||||
/// to compile.
|
/// 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> {
|
fn build_matcher_dynamic(segs: &[MatcherSegment]) -> Option<GlobMatcher> {
|
||||||
// join segments
|
// join segments
|
||||||
let mut buf = String::new();
|
let mut buf = String::new();
|
||||||
@ -83,7 +83,7 @@ fn build_matcher_dynamic(segs: &[MatcherSegment]) -> Option<GlobMatcher> {
|
|||||||
|
|
||||||
/// A segment of a dynamic builtin matcher.
|
/// 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)]
|
#[derive(Clone, Debug)]
|
||||||
enum MatcherSegment {
|
enum MatcherSegment {
|
||||||
Text(&'static str),
|
Text(&'static str),
|
||||||
|
Loading…
Reference in New Issue
Block a user