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

Consider adding variants for Writeable write_len #370

Closed
sffc opened this issue Oct 24, 2020 · 2 comments · Fixed by #1400
Closed

Consider adding variants for Writeable write_len #370

sffc opened this issue Oct 24, 2020 · 2 comments · Fixed by #1400
Assignees
Labels
A-design Area: Architecture or design C-numbers Component: Numbers, units, currencies S-medium Size: Less than a week (larger bug fix or enhancement) T-enhancement Type: Nice-to-have but not required
Milestone

Comments

@sffc
Copy link
Member

sffc commented Oct 24, 2020

Context: https://github.com/unicode-org/icu4x/pull/364/files#r511199181

We should consider making the write_len function of the Writeable trait return an enumeration expressing the confidence in the return value. For example:

pub enum WriteableLength {
    Exact(usize),
    Approximate(usize),
    LessThanOrEqual(usize),
    GreaterThanOrEqual(usize),
}

I would like to see more concrete use cases before introducing these additional variants.

@sffc sffc added A-design Area: Architecture or design backlog C-numbers Component: Numbers, units, currencies T-enhancement Type: Nice-to-have but not required labels Oct 24, 2020
@sffc sffc self-assigned this Oct 24, 2020
@zbraniecki
Copy link
Member

I think we'll need also "Unknown".

@sffc
Copy link
Member Author

sffc commented Oct 26, 2020

I think we'll need also "Unknown".

I struggle to think of a use case where that would be required; I think in most cases you can at least assert > or <.

@sffc sffc added the S-medium Size: Less than a week (larger bug fix or enhancement) label Apr 3, 2021
@robertbastian robertbastian assigned robertbastian and unassigned sffc Dec 15, 2021
@sffc sffc added this to the ICU4X 0.5 milestone Apr 1, 2022
@sffc sffc removed backlog labels Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-design Area: Architecture or design C-numbers Component: Numbers, units, currencies S-medium Size: Less than a week (larger bug fix or enhancement) T-enhancement Type: Nice-to-have but not required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants