Move impl Node
just after struct Node
.
This commit is contained in:
parent
201afa6455
commit
4ecd94e121
1 changed files with 16 additions and 16 deletions
|
@ -196,6 +196,22 @@ struct Node<O> {
|
||||||
obligation_tree_id: ObligationTreeId,
|
obligation_tree_id: ObligationTreeId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<O> Node<O> {
|
||||||
|
fn new(
|
||||||
|
parent: Option<NodeIndex>,
|
||||||
|
obligation: O,
|
||||||
|
obligation_tree_id: ObligationTreeId
|
||||||
|
) -> Node<O> {
|
||||||
|
Node {
|
||||||
|
obligation,
|
||||||
|
state: Cell::new(NodeState::Pending),
|
||||||
|
parent,
|
||||||
|
dependents: vec![],
|
||||||
|
obligation_tree_id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The state of one node in some tree within the forest. This
|
/// The state of one node in some tree within the forest. This
|
||||||
/// represents the current state of processing for the obligation (of
|
/// represents the current state of processing for the obligation (of
|
||||||
/// type `O`) associated with this node.
|
/// type `O`) associated with this node.
|
||||||
|
@ -725,22 +741,6 @@ impl<O: ForestObligation> ObligationForest<O> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<O> Node<O> {
|
|
||||||
fn new(
|
|
||||||
parent: Option<NodeIndex>,
|
|
||||||
obligation: O,
|
|
||||||
obligation_tree_id: ObligationTreeId
|
|
||||||
) -> Node<O> {
|
|
||||||
Node {
|
|
||||||
obligation,
|
|
||||||
state: Cell::new(NodeState::Pending),
|
|
||||||
parent,
|
|
||||||
dependents: vec![],
|
|
||||||
obligation_tree_id,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// I need a Clone closure.
|
// I need a Clone closure.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct GetObligation<'a, O>(&'a [Node<O>]);
|
struct GetObligation<'a, O>(&'a [Node<O>]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue