Skip to content

Commit dd84fb4

Browse files
committed
CI Cleanup
1 parent f6fbaf9 commit dd84fb4

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/local_executor.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ impl<'a> LocalExecutor<'a> {
152152
let mut active = self.state().active();
153153

154154
// Convert the futures into tasks.
155-
let tasks = futures.into_iter().map(move |future| {
156-
self.spawn_inner(future, &mut active)
157-
});
155+
let tasks = futures
156+
.into_iter()
157+
.map(move |future| self.spawn_inner(future, &mut active));
158158

159159
// Push the tasks to the user's collection.
160160
handles.extend(tasks);
@@ -190,16 +190,16 @@ impl<'a> LocalExecutor<'a> {
190190
// the `Executor` is drained of all of its runnables. This ensures that
191191
// runnables are dropped and this precondition is satisfied.
192192
//
193-
// `self.schedule()` is not `Send` nor `Sync`. As LocalExecutor is not
193+
// `self.schedule()` is not `Send` nor `Sync`. As LocalExecutor is not
194194
// `Send`, the `Waker` is guaranteed// to only be used on the same thread
195195
// it was spawned on.
196196
//
197-
// `self.schedule()` is `'static`, and thus will outlive all borrowed
197+
// `self.schedule()` is `'static`, and thus will outlive all borrowed
198198
// variables in the future.
199199
let (runnable, task) = unsafe {
200200
Builder::new()
201-
.propagate_panic(true)
202-
.spawn_unchecked(|()| future, self.schedule())
201+
.propagate_panic(true)
202+
.spawn_unchecked(|()| future, self.schedule())
203203
};
204204
entry.insert(runnable.waker());
205205

@@ -407,7 +407,9 @@ impl State {
407407
// A future that runs tasks forever.
408408
let run_forever = async {
409409
loop {
410-
ticker.runnable().await.run();
410+
for _ in 0..200 {
411+
ticker.runnable().await.run();
412+
}
411413
future::yield_now().await;
412414
}
413415
};

src/static_executors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,11 @@ impl StaticLocalExecutor {
417417
// `future` is not `'static`, but the caller guarantees that the
418418
// task, and thus its `Runnable` must not live longer than `'a`.
419419
//
420-
// `self.schedule()` is not `Send` nor `Sync`. As StaticLocalExecutor is not
420+
// `self.schedule()` is not `Send` nor `Sync`. As StaticLocalExecutor is not
421421
// `Send`, the `Waker` is guaranteed// to only be used on the same thread
422422
// it was spawned on.
423423
//
424-
// `self.schedule()` is `'static`, and thus will outlive all borrowed
424+
// `self.schedule()` is `'static`, and thus will outlive all borrowed
425425
// variables in the future.
426426
let (runnable, task) = unsafe {
427427
Builder::new()

tests/larger_tasks.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use futures_lite::future::{self, block_on};
55
use futures_lite::prelude::*;
66

77
use std::sync::Arc;
8+
use std::rc::Rc;
89
use std::thread;
910
use std::time::Duration;
1011

@@ -99,7 +100,7 @@ fn do_run_local<Fut: Future<Output = ()>>(mut f: impl FnMut(Arc<LocalExecutor<'s
99100
stop_timeout
100101
};
101102

102-
let ex = Arc::new(LocalExecutor::new());
103+
let ex = Rc::new(LocalExecutor::new());
103104

104105
// Test 1: Use the `run` command.
105106
block_on(ex.run(f(ex.clone())));

0 commit comments

Comments
 (0)