Skip to content

Commit dc9c503

Browse files
committed
refactor: Rename cwd as full_path_base
Because I think it makes it's intention more clear.
1 parent cd4fd03 commit dc9c503

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct Config {
1717

1818
/// Cached current working directory for absolute path construction.
1919
/// Populated when `--full-path` is set; `None` means search by filename only.
20-
pub cwd: Option<PathBuf>,
20+
pub full_path_base: Option<PathBuf>,
2121

2222
/// Whether to ignore hidden files and directories (or not).
2323
pub ignore_hidden: bool,

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ fn construct_config(mut opts: Opts, pattern_regexps: &[String]) -> Result<Config
245245
let command = extract_command(&mut opts, colored_output)?;
246246
let has_command = command.is_some();
247247

248-
let cwd = if opts.full_path {
248+
let full_path_base = if opts.full_path {
249249
Some(env::current_dir().context(
250250
"Could not determine current directory. \
251251
This is required for --full-path.",
@@ -256,7 +256,7 @@ fn construct_config(mut opts: Opts, pattern_regexps: &[String]) -> Result<Config
256256

257257
Ok(Config {
258258
case_sensitive,
259-
cwd,
259+
full_path_base,
260260
ignore_hidden: !(opts.hidden || opts.rg_alias_ignore()),
261261
read_fdignore: !(opts.no_ignore || opts.rg_alias_ignore()),
262262
read_vcsignore: !(opts.no_ignore || opts.rg_alias_ignore() || opts.no_ignore_vcs),

src/walk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ impl WorkerState {
524524
// Check the name first, since it doesn't require metadata
525525
let entry_path = entry.path();
526526

527-
let search_str = search_str_for_entry(entry_path, config.cwd.as_deref());
527+
let search_str = search_str_for_entry(entry_path, config.full_path_base.as_deref());
528528

529529
if !patterns
530530
.iter()

0 commit comments

Comments
 (0)