Skip to content

Consider using Rc<str> and other copy-friendly types when returning DNS data to the user. #6

Description

@m-kuzmin

This library is really cool, thanks for making this.

When rendering the results in my app, I found that I clone() String a lot. Since the results returned are not meant to be mutated by the user, it would be nice if those copies were just an increment of the reference count and not actual data copies.

I am not sure how to best approach this, however, because some users may wish to use an Arc instead. My current usecase is making dig in the browser with WASM and I do not need to use Arcs just yet. But may a type alias and a feature flag to turn that type alias into an Arc<str> is the way to go.

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