-
Notifications
You must be signed in to change notification settings - Fork 225
Refactor env_preferences to host_info #7113
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
base: main
Are you sure you want to change the base?
Conversation
7b7864e
to
84e83fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API overall looks quite straightforward
/// assert_eq!(attrs, "foobar-foobaz-fooqux".parse().unwrap()); | ||
/// ``` | ||
#[cfg(feature = "alloc")] | ||
pub fn extend(&mut self, other: Attributes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: these are new public APIs, we should consider these carefully
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is reviewed in #7112
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks!
|
||
/// An error encountered while retrieving the host information | ||
#[derive(Debug, Display)] | ||
pub enum HostInfoError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought (non blocking for initial landing): We should eventually consider whether we should split this into fine grained errors. Probably not, most of these are general.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went back and forth on this and ended up coalescing. The original crate had more types of errors but I couldn't find a persona except of "ICU4X code contributor" who would be affected to the point where different classes of errors make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
use crate::error::HostInfoError; | ||
|
||
#[derive(Hash, Eq, PartialEq, Debug, Clone, Copy)] | ||
pub enum LocaleCategory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: is this actually pub, or just pub(crate)? Should this be under shared/ or something so that backend-specific stuff is distinct from API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many different OSes use some parts of POSIX (Android, Mac, Linux, Vega). I'm open to adjust visibility.
Right now it is private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, this should be pub(crate)
And perhaps the file should be under backends/shared/posix.rs
I'll need help figuring out how to avoid enabling |
Depends on #7112 .
Partially resolves #5869 implementing refactor plus documentation, and fixing #6574 .