-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Future for SmallBox<F> where F: Future #39
Conversation
would you like to add an example demonstrating how SmallBox can be uesd in async context? |
You mean demonstrate to you, or add it to the repository somewhere? To the readme? |
It's really pretty simple, similar to the std Here's a simple example: async fn foo() {
let fut = async {
sleep(Duration::from_secs(1)).await;
println!("finished");
};
let boxed_fut: SmallBox<_, S1> = SmallBox::new(fut);
let erased = boxed_fut as SmallBox<dyn Future<Output = ()>, S1>;
erased.await;
} |
Looks good to me. And would you like to add the async example into the unit tests, to ensure the impl Future works? |
@andylokandy I could, but then I would need to pull in some Personally I don't think this needs any testing since this feature is pretty much a compile time thing. |
is pollster sufficient? |
Yes. I will do it with |
There is a conflict in the commit. I'll merge once it's resolved. |
Hmm probably pollster doesn't support this MSRV Yep, pollster's MSRV is 1.69, while this project is 1.56 |
I can switch to |
Released 0.8.6 #41 |
Previously discussed in #38
Additionally I ran
cargo fmt
in the repository.I am pretty certain that this is safe and sound, but if you want to discuss this further I will gladly do so.
Closes #38