mirror of
https://github.com/nushell/nushell.git
synced 2025-08-20 04:29:44 +02:00
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:
@@ -17,6 +17,7 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
nu-utils = { path = "../nu-utils", version = "0.103.1", default-features = false }
|
||||
nu-glob = { path = "../nu-glob", version = "0.103.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.103.1" }
|
||||
nu-system = { path = "../nu-system", version = "0.103.1" }
|
||||
nu-derive-value = { path = "../nu-derive-value", version = "0.103.1" }
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use crate::{ShellError, Span};
|
||||
use nu_glob::Interruptible;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Used to check for signals to suspend or terminate the execution of Nushell code.
|
||||
///
|
||||
/// For now, this struct only supports interruption (ctrl+c or SIGINT).
|
||||
@@ -84,6 +84,13 @@ impl Signals {
|
||||
}
|
||||
}
|
||||
|
||||
impl Interruptible for Signals {
|
||||
#[inline]
|
||||
fn interrupted(&self) -> bool {
|
||||
self.interrupted()
|
||||
}
|
||||
}
|
||||
|
||||
/// The types of things that can be signaled. It's anticipated this will change as we learn more
|
||||
/// about how we'd like signals to be handled.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user