Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BoundedVec more #3

Open
olehmisar opened this issue Sep 11, 2024 · 0 comments · May be fixed by #14
Open

Use BoundedVec more #3

olehmisar opened this issue Sep 11, 2024 · 0 comments · May be fixed by #14
Labels
enhancement New feature or request

Comments

@olehmisar
Copy link
Contributor

Problem

BoundedVec is a structure that represents a (arr, len) pair. StringBody::new and SubString::new should accept BoundedVec as a parameter (or implement From)

Happy Case

let haystack_text = BoundedVec::from_array("the quick brown fox jumped over the lazy dog".as_bytes());
let needle_text = BoundedVec::from_array(" the lazy dog".as_bytes());

let haystack: StringBody64 = StringBody::new(haystack_text);
let needle: SubString32 = SubString::new(needle_text);

// or even
let haystack: StringBody64 = haystack_text.into();

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

Nice-to-have

Blocker Context

No response

Would you like to submit a PR for this Issue?

Maybe

Support Needs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant