Skip to content

Avoid iterating Vec<T> when ToProxy::Output == Vec<T> #3

@chenyan2002

Description

@chenyan2002

The ToProxy trait iterates through Vec<T> to convert each element in the vector. When Output type is exactly Vec<T>, we can just return self to save time. Due to Rust's trait specialization, this is not possible at the moment.

There are two ways to do this: 1) Use unstable rust to build proxy component; 2) Implement ToProxy for all vector types appeared in WIT in the codegen, without using the generic T type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions