floop 0.3.2

A more convenient and less error prone replacement for loop `{ select! { .. }}`
Documentation
//! i'm using the term `deadlock` because i can't find a word for "bug that prevent the program from progressing in some way",
//! please open an issue if you know the correct word.

use std::{thread, time::{Duration, Instant}};

use smol::{LocalExecutor, Timer, channel};
use floop::floop;

/// occured on `0.2.0`.
#[test]
fn return_infinite_loop() {
    let start = Instant::now();
    let thread = thread::spawn(|| {
        let executor = LocalExecutor::new();
        let (send, receive) = channel::unbounded();
    
        executor.spawn(async move {
            loop {
                Timer::after(Duration::from_millis(50)).await;
                send.send(()).await.unwrap();
            }
        }).detach();
        let task = executor.spawn(async move {
            let mut counter = 5;

            floop! {
                // i don't think biasedness affects the deadlock.
                unbiased
                return
                result in receive.recv()=> {
                    result.unwrap();
                    counter -= 1;
                    if counter == 0 {
                        return;
                    }
                }
            }
        });

        while !task.is_finished() {
            executor.try_tick();
        }
    });

    while start.elapsed() < Duration::from_millis(1000) {
        if thread.is_finished() {
            thread.join().unwrap();
            return;
        }
    }

    panic!("the threat is stuck");
}