Skip to content

Commit c092763

Browse files
committed
get rid of debug printlns
1 parent 6582494 commit c092763

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

src/runtime/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mod block_on;
1414
mod reactor;
1515

1616
pub use block_on::block_on;
17-
pub use reactor::Reactor;
17+
pub use reactor::{AsyncPollable, Reactor};
1818
use std::cell::RefCell;
1919

2020
// There are no threads in WASI 0.2, so this is just a safe way to thread a single reactor to all

src/runtime/reactor.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ impl future::Future for WaitFor {
6969
}
7070
impl Drop for WaitFor {
7171
fn drop(&mut self) {
72-
println!("dropping {:?}", self);
7372
if self.needs_deregistration {
7473
Reactor::current().deregister_waitee(&self.waitee)
7574
}
@@ -149,7 +148,6 @@ impl Reactor {
149148
"Attempting to block on an empty list of pollables - without any pending work, no progress can be made and wasi::io::poll::poll will trap"
150149
);
151150

152-
println!("polling for {indexes:?}");
153151
// Now that we have that association, we're ready to poll our targets.
154152
// This will block until an event has completed.
155153
let ready_indexes = wasi::io::poll::poll(&targets);
@@ -165,30 +163,26 @@ impl Reactor {
165163
for key in ready_keys {
166164
for (waitee, waker) in reactor.wakers.iter() {
167165
if waitee.pollable.0.key == key {
168-
println!("waking {key:?}");
169166
waker.wake_by_ref()
170167
}
171168
}
172169
}
173170
}
174171

175-
/// Turn a wasi [`Pollable`] into an [`AsyncPollable`]
172+
/// Turn a Wasi [`Pollable`] into an [`AsyncPollable`]
176173
pub fn schedule(&self, pollable: Pollable) -> AsyncPollable {
177174
let mut reactor = self.inner.borrow_mut();
178175
let key = EventKey(reactor.pollables.insert(pollable));
179-
println!("schedule pollable as {key:?}");
180176
AsyncPollable(Rc::new(Registration { key }))
181177
}
182178

183179
fn deregister_event(&self, key: EventKey) {
184180
let mut reactor = self.inner.borrow_mut();
185-
println!("deregister {key:?}",);
186181
reactor.pollables.remove(key.0);
187182
}
188183

189184
fn deregister_waitee(&self, waitee: &Waitee) {
190185
let mut reactor = self.inner.borrow_mut();
191-
println!("deregister waker for {waitee:?}",);
192186
reactor.wakers.remove(waitee);
193187
}
194188

@@ -200,10 +194,8 @@ impl Reactor {
200194
.expect("only live EventKey can be checked for readiness")
201195
.ready();
202196
if !ready {
203-
println!("register waker for {waitee:?}");
204197
reactor.wakers.insert(waitee.clone(), waker.clone());
205198
}
206-
println!("ready {ready} {waitee:?}");
207199
ready
208200
}
209201

src/time/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ impl AsyncIterator for Interval {
4242
type Item = Instant;
4343

4444
async fn next(&mut self) -> Option<Self::Item> {
45-
Timer::after(self.duration).await;
46-
Some(Instant::now())
45+
Some(Timer::after(self.duration).await)
4746
}
4847
}
4948

@@ -86,3 +85,8 @@ impl Future for Timer {
8685
}
8786
}
8887
}
88+
89+
#[cfg(test)]
90+
mod test {
91+
use super::*;
92+
}

0 commit comments

Comments
 (0)