Skip to content

Commit 88b79ce

Browse files
committed
[topo] Remove im-rc dep and move __reset hack into a separate root! macro.
`topo::Point::__enter_child` -> `topo::__enter_child`, which allows us to make `Point` private to the crate. `topo::Point::__reset`/`topo::__reset` -> `topo::root!` which is an analog to `topo::call!` but also leaves the parent state intact after calling the inner expression.
1 parent e5c1772 commit 88b79ce

File tree

3 files changed

+173
-104
lines changed

3 files changed

+173
-104
lines changed

src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub async fn runloop(mut root: impl FnMut(&state::Key<LoopBehavior>)) {
118118
loop {
119119
current_revision.0 += 1;
120120

121-
topo::call!(|| {
121+
topo::root!(|| {
122122
let (_, behavior) = state!((), |()| LoopBehavior::default());
123123

124124
// CALLER'S CODE IS CALLED HERE
@@ -131,9 +131,6 @@ pub async fn runloop(mut root: impl FnMut(&state::Key<LoopBehavior>)) {
131131
Revision => current_revision
132132
});
133133

134-
// TODO break this by adding test with multiple identical runloops that clobber each other
135-
topo::Point::__reset();
136-
137134
match next_behavior.as_ref().unwrap().deref() {
138135
LoopBehavior::OnWake => {
139136
trace!(target: "runloop_pending", revision = debug(&current_revision));

topo/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ authors = ["Adam Perry <adam.n.perry@gmail.com>"]
55
edition = "2018"
66

77
[dependencies]
8-
im-rc = "13"
98
owning_ref = "0.4"
109
tokio-trace = { version = "0.1", features = ["log"] }
1110
topo-macro = { path = "macro" }

0 commit comments

Comments
 (0)