zxcv05 / hubbub

Rust library for creating discord self-bots
GNU General Public License v3.0
4 stars 2 forks source link

Make Handler sendable #6

Closed jameshi16 closed 3 weeks ago

jameshi16 commented 3 weeks ago

In the current implementation, Handle is not sendable. The following code hence will not compile:

struct SimpleStructure;

fn quick_test() -> impl Future<Output = ()> + Send {
    async move {
        Client::new(SimpleStructure, Box::new(|_, _, _, _| async move {})).await;
    }
}

This PR makes Handler sendable.

zxcv05 commented 3 weeks ago

Looks good to me, thanks!

zxcv05 commented 3 weeks ago

The latest version (containing this commit) has just been published