Skip to content

Commit 609868d

Browse files
Rename Glob to Pattern (#1479)
Just an internal rename Change: glob-to-pattern
1 parent cef3164 commit 609868d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

josh-core/src/filter/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ enum Op {
156156
Subdir(std::path::PathBuf),
157157
Workspace(std::path::PathBuf),
158158

159-
Glob(String),
159+
Pattern(String),
160160
Message(String),
161161

162162
Compose(Vec<Filter>),
@@ -486,7 +486,7 @@ fn spec2(op: &Op) -> String {
486486
Op::Subdir(path) => format!(":/{}", parse::quote_if(&path.to_string_lossy())),
487487
Op::File(path) => format!("::{}", parse::quote_if(&path.to_string_lossy())),
488488
Op::Prefix(path) => format!(":prefix={}", parse::quote_if(&path.to_string_lossy())),
489-
Op::Glob(pattern) => format!("::{}", parse::quote_if(pattern)),
489+
Op::Pattern(pattern) => format!("::{}", parse::quote_if(pattern)),
490490
Op::Author(author, email) => {
491491
format!(":author={};{}", parse::quote(author), parse::quote(email))
492492
}
@@ -1011,7 +1011,7 @@ fn apply2<'a>(
10111011
Ok(t)
10121012
}
10131013

1014-
Op::Glob(pattern) => {
1014+
Op::Pattern(pattern) => {
10151015
let pattern = glob::Pattern::new(pattern)?;
10161016
let options = glob::MatchOptions {
10171017
case_sensitive: true,

josh-core/src/filter/opt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ pub fn invert(filter: Filter) -> JoshResult<Filter> {
494494
Op::Subdir(path) => Some(Op::Prefix(path)),
495495
Op::File(path) => Some(Op::File(path)),
496496
Op::Prefix(path) => Some(Op::Subdir(path)),
497-
Op::Glob(pattern) => Some(Op::Glob(pattern)),
497+
Op::Pattern(pattern) => Some(Op::Pattern(pattern)),
498498
Op::Rev(_) => Some(Op::Nop),
499499
Op::RegexReplace(_) => Some(Op::Nop),
500500
_ => None,

josh-core/src/filter/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn parse_item(pair: pest::iterators::Pair<Rule>) -> JoshResult<Op> {
7777
to_filter(make_op(&["prefix", arg])?),
7878
))
7979
} else if arg.contains('*') {
80-
Ok(Op::Glob(arg.to_string()))
80+
Ok(Op::Pattern(arg.to_string()))
8181
} else {
8282
Ok(Op::File(Path::new(arg).to_owned()))
8383
}

0 commit comments

Comments
 (0)