We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
&str
The text was updated successfully, but these errors were encountered:
FWIW I'm currently doing this with newtype, which generally works pretty well:
pub struct ProductionSetItem(Production); impl Deref for ProductionSetItem { type Target = Production; fn deref(&self) -> &Production { &self.0 } } impl Borrow<str> for ProductionSetItem { fn borrow(&self) -> &str { &self.name } } impl PartialEq for ProductionSetItem { fn eq(&self, other: &Self) -> bool { self.name == other.name } } impl Eq for ProductionSetItem {} impl Hash for ProductionSetItem { fn hash<H: Hasher>(&self, state: &mut H) { self.name.hash(state) } }
Maybe it's worth just providing some macro to generate them automatically?
Sorry, something went wrong.
No branches or pull requests
&str
.The text was updated successfully, but these errors were encountered: