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

Decide on names of ZeroTrie as_borrowed and as_borrowed_slice #4393

Open
sffc opened this issue Nov 30, 2023 · 4 comments
Open

Decide on names of ZeroTrie as_borrowed and as_borrowed_slice #4393

sffc opened this issue Nov 30, 2023 · 4 comments
Assignees
Labels
C-zerovec Component: Yoke, ZeroVec, DataBake
Milestone

Comments

@sffc
Copy link
Member

sffc commented Nov 30, 2023

See #4381

We have functions that return both &ZeroTrie<[u8]> and ZeroTrie<&[u8]>. How should we name them to be clear? The current names are not intended to be final.

@sffc sffc added discuss Discuss at a future ICU4X-SC meeting C-zerovec Component: Yoke, ZeroVec, DataBake labels Nov 30, 2023
@sffc sffc added this to the Utilities 1.0 milestone Nov 30, 2023
@robertbastian
Copy link
Member

Do these even need to be public now that we have the separate cursor type?

@sffc
Copy link
Member Author

sffc commented Dec 1, 2023

I would like to resolve the name bikeshed under the assumption that these functions are useful, which I believe they are, even if we aren't using them in the lookup PR any more.

@sffc
Copy link
Member Author

sffc commented Dec 7, 2023

Discuss with:

@sffc sffc added the discuss-triaged The stakeholders for this issue have been identified and it can be discussed out-of-band label Dec 7, 2023
@sffc
Copy link
Member Author

sffc commented Mar 15, 2024

impl ZeroTrieSimpleAscii<Store: AsRef<[u8]> + ?Sized> {
    pub const fn as_ref(&self) -> &ZeroTrieSimpleAscii<[u8]>
}

impl &ZeroTrieSimpleAscii<[u8]> {
    pub fn borrowed_store(self) -> ZeroTrieSimpleAscii<&[u8]>;
}

impl<Store: AsRef<[u8]> + ?Sized> AsRef<ZeroTrieSimpleAscii<[u8]>> for ZeroTrieSimpleAscii<Store> {
    fn as_ref(&self) => &ZeroTrieSimpleAscii<[u8]> {}
}

LGTM: @Manishearth @sffc @robertbastian

@robertbastian robertbastian removed discuss Discuss at a future ICU4X-SC meeting discuss-triaged The stakeholders for this issue have been identified and it can be discussed out-of-band labels Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-zerovec Component: Yoke, ZeroVec, DataBake
Projects
None yet
Development

No branches or pull requests

3 participants