This commit is contained in:
luojia65 2021-04-24 23:14:54 +08:00
parent 369a55aa15
commit 7b305f171b
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ impl FibonacciFuture {
}
impl Future for FibonacciFuture {
type Output = ();
type Output = usize;
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
if self.i == self.cnt {
println!("Fibonacci result: {}", self.a);

View File

@ -35,7 +35,7 @@ pub extern "C" fn user_should_switch(_handle: &SharedTaskHandle) -> bool {
}
// 该执行器目前是测试使用,当轮询到一个完成的任务就退出了
pub fn run_until_idle(
pub fn run_until_ready(
peek_task: impl Fn() -> TaskResult,
delete_task: impl Fn(usize) -> bool,
) {