Skip to content

Directly build an owned Finder #173

@marmeladema

Description

@marmeladema

Hi :)

I have a use case where I already have an owned needle in the form of Vec<u8> / Box<[u8]> and we would like to build an owned Finder.
As far as I aware, the way to go is to:

let finder = Finder:new(&bytes).into_owned();

but this will pass the bytes by reference, just to heap allocate them again in the into_owned() call.
Is there a way to directly build an owned Finder without requiring an additional heap allocation and drop? I am very sorry if I have missed it!
The code in question is very performance sensitive and we would like to avoid paying any extra cost that we think could be avoided.

If you think this is something that this crate could offer, I am happy to work on the implementation.

Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions