Remove nu-glob's dependency on nu-protocol (#15349)

# Description

This PR solves a circular dependency issue (`nu-test-support` needs
`nu-glob` which needs `nu-protocol` which needs `nu-test-support`). This
was done by making the glob functions that any type that implements
`Interruptible` to remove the dependency on `Signals`.

# After Submitting

Make `Paths.next()` a O(1) operation so that cancellation/interrupt
handling can be moved to the caller (e.g., by wrapping the `Paths`
iterator in a cancellation iterator).
This commit is contained in:
Ian Manske
2025-03-20 09:32:41 -07:00
committed by GitHub
parent b241e9edd5
commit dfba62da00
8 changed files with 81 additions and 59 deletions

View File

@ -158,17 +158,15 @@ impl Command for UTouch {
continue;
}
let mut expanded_globs = glob(
&file_path.to_string_lossy(),
Some(engine_state.signals().clone()),
)
.unwrap_or_else(|_| {
panic!(
"Failed to process file path: {}",
&file_path.to_string_lossy()
)
})
.peekable();
let mut expanded_globs =
glob(&file_path.to_string_lossy(), engine_state.signals().clone())
.unwrap_or_else(|_| {
panic!(
"Failed to process file path: {}",
&file_path.to_string_lossy()
)
})
.peekable();
if expanded_globs.peek().is_none() {
let file_name = file_path.file_name().unwrap_or_else(|| {