3 ms·
Type aliases and new types are two subtly different features. The new type pattern allows you to provide new impls for the underlying type (it is a new type af
by duped 3y ago
Type aliases and new types are two subtly different features. The new type pattern allows you to provide new impls for the underlying type (it is a new type after all) while the type alias is pure sugar where type T = U allows the string T to be substituted for U in any place where T is imported. If U is a foreign type you cannot provide new trait impls for it.