We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Block::call
Calling blocks should be possible without having to specify the awkward tuple argument (i.e. block.call((42,))).
block.call((42,))
Idea for solution (playground), credit to @yury for the idea:
impl<R> Block<dyn Fn() -> R> { pub fn call(&self) -> R { unimplemented!() } } impl<A, R> Block<dyn Fn(A) -> R> { pub fn call(&self, arg0: A) -> R { unimplemented!() } } // ...
Though of course, with the fn_traits feature, this would be even prettier.
fn_traits
The text was updated successfully, but these errors were encountered:
block2
No branches or pull requests
Calling blocks should be possible without having to specify the awkward tuple argument (i.e.
block.call((42,))
).Idea for solution (playground), credit to @yury for the idea:
Though of course, with the
fn_traits
feature, this would be even prettier.The text was updated successfully, but these errors were encountered: