You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you ever considered supporting newtype derivations for string-backed identifiers?
I'm thinking of a similar reference-buffer duality as one between std::path::Path and PathBuf that gives you an option to wrap a str with the newtype without allocating, e.g.:
structDatasetID(str);structDatasetIDBuf(String);
While some of the existing derivations are compatible with these types it still leaves a large enough amount of boilerplate to be written to enable conversions and comparisons between the two to discourage the use of the newtype pattern for string.
The text was updated successfully, but these errors were encountered:
Have you ever considered supporting newtype derivations for string-backed identifiers?
I'm thinking of a similar reference-buffer duality as one between
std::path::Path
andPathBuf
that gives you an option to wrap astr
with the newtype without allocating, e.g.:While some of the existing derivations are compatible with these types it still leaves a large enough amount of boilerplate to be written to enable conversions and comparisons between the two to discourage the use of the newtype pattern for string.
The text was updated successfully, but these errors were encountered: