Skip to content

Type parameter P in AsyncWormhole #1

@kaimast

Description

@kaimast

(Yay, this seems to be the first issue :) )

I noticed a small issue with the latest version of async-wormhole. When you do not define a pre_post_poll handler for async wormhole it will throw an error like this one:

error[E0698]: type inside `async fn` body must be known in this context
   --> lib/api/src/instance.rs:190:20
    |
190 |         let task = async_wormhole::AsyncWormhole::new(stack, |yielder| -> Result<Box<[crate::Val]>, RuntimeError> {
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `P`
    |
note: the type is part of the `async fn` body because of this `await`

The easiest way to fix this is to just set an empty lambda function like so, but that's a little ugly.

task.set_pre_post_poll(|| {});

Maybe we can hide function this method feature flag or require the handler to always be set? I think the error might be super confusing for some users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions