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

ZeroVec::from_slice_or_alloc requires implementation of EqULE which shouldn't be needed as the method #2018

Closed
pandusonu2 opened this issue Jun 7, 2022 · 3 comments
Labels
invalid This doesn't make sense

Comments

@pandusonu2
Copy link
Contributor

from_slice_or_allow trait shouldn't require EqULE, as only slice method requires that implementation, https://github.com/unicode-org/icu4x/blob/main/utils/zerovec/src/zerovec/mod.rs#L574

@sffc
Copy link
Member

sffc commented Jun 7, 2022

EqULE's sole purpose of existing is so that from_slice_or_alloc can work.

I want to move away from EqULE and from_slice_or_alloc in favor of const-constructing a ZeroSlice (#1935).

@Manishearth
Copy link
Member

I'm not 100% sure if the const stuff would cover all use cases of from_slice_or_alloc fwiw. It does for our examples, but our examples don't cover everything

@sffc
Copy link
Member

sffc commented Jun 7, 2022

The use case for which EqULE/from_slice_or_alloc was introduced was having more readable, aligned data in code files, converted to ULE for runtime use. Const functions in #1935 solve this use case.

Last I looked around the code base at from_slice_or_alloc call sites, they mostly fit into this bucket. Any call sites that are for other cases may have separate solutions that are superior.

@sffc sffc added the invalid This doesn't make sense label Jun 9, 2022
@sffc sffc closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't make sense
Projects
None yet
Development

No branches or pull requests

3 participants