fix job_queue/tests.rs's 5 dead NodeKind::as_str() call sites, dead since the first wrapper removal
This commit is contained in:
parent
7773f10646
commit
fa139342ed
1 changed files with 5 additions and 5 deletions
|
|
@ -146,12 +146,12 @@ fn declared_shape(q: &JobQueue) -> Vec<Declared> {
|
||||||
fn declared_shape_filtered(q: &JobQueue, keep: &dyn Fn(&NodeKind) -> bool) -> Vec<Declared> {
|
fn declared_shape_filtered(q: &JobQueue, keep: &dyn Fn(&NodeKind) -> bool) -> Vec<Declared> {
|
||||||
let sched = q.sched().lock().expect("job_queue mutex poisoned");
|
let sched = q.sched().lock().expect("job_queue mutex poisoned");
|
||||||
let graph = sched.graph();
|
let graph = sched.graph();
|
||||||
let kind_of = |id: NodeId| graph.node(id).map(|n| n.payload.as_str());
|
let kind_of = |id: NodeId| graph.node(id).map(|n| <&str>::from(&n.payload));
|
||||||
graph
|
graph
|
||||||
.nodes()
|
.nodes()
|
||||||
.filter(|n| keep(&n.payload))
|
.filter(|n| keep(&n.payload))
|
||||||
.map(|n| Declared {
|
.map(|n| Declared {
|
||||||
kind: n.payload.as_str(),
|
kind: <&str>::from(&n.payload),
|
||||||
parent: n.parent.and_then(kind_of),
|
parent: n.parent.and_then(kind_of),
|
||||||
after: n
|
after: n
|
||||||
.deps
|
.deps
|
||||||
|
|
@ -175,7 +175,7 @@ fn node_of(q: &JobQueue, kind: &str) -> hive_jobq::NodeId {
|
||||||
let graph = sched.graph();
|
let graph = sched.graph();
|
||||||
let mut found: Vec<_> = graph
|
let mut found: Vec<_> = graph
|
||||||
.nodes()
|
.nodes()
|
||||||
.filter(|n| n.payload.as_str() == kind)
|
.filter(|n| <&str>::from(&n.payload) == kind)
|
||||||
.map(|n| n.id)
|
.map(|n| n.id)
|
||||||
.collect();
|
.collect();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
@ -225,7 +225,7 @@ fn pending_kinds_filtered(q: &JobQueue, keep: &dyn Fn(&NodeKind) -> bool) -> Vec
|
||||||
graph
|
graph
|
||||||
.nodes()
|
.nodes()
|
||||||
.filter(|n| n.state == State::Pending && keep(&n.payload))
|
.filter(|n| n.state == State::Pending && keep(&n.payload))
|
||||||
.map(|n| n.payload.as_str())
|
.map(|n| <&str>::from(&n.payload))
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -275,7 +275,7 @@ fn declared_resources_of_kind(q: &JobQueue, kind: &str) -> Vec<Vec<Resource>> {
|
||||||
let graph = sched.graph();
|
let graph = sched.graph();
|
||||||
let mut rows: Vec<Vec<Resource>> = graph
|
let mut rows: Vec<Vec<Resource>> = graph
|
||||||
.nodes()
|
.nodes()
|
||||||
.filter(|n| n.payload.as_str() == kind)
|
.filter(|n| <&str>::from(&n.payload) == kind)
|
||||||
.map(|n| {
|
.map(|n| {
|
||||||
n.deps
|
n.deps
|
||||||
.iter()
|
.iter()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue