Closed TrolledWoods closed 4 years ago
Thanks, this is a great idea. Just so I understand correctly , this doesn’t really change anything in Ustr itself but allows space optimisations where a Ustr is stored in e.g. an Option?
Yes, NonNull is just a pointer under the hood like *const T is but it has an invariant that it's not null that the compiler knows about.
Since the pointer inside Ustr is never supposed to be null anyway it felt like a waste to not space optimize it.