This is a minor ergonomic improvement which allows us to write:
ConstGenericRingBuffer::new::<5>()
instead of
ConstGenericRingBuffer::<_, 5>::new()
when the type can be inferred, saving a grand total of 2 characters (3 if you count the space)!
This trick (ab)uses From as a stand-in for an identity trait. This is probably fine, because there is only one possible implementation of the from method, which is the identity function, since From is guaranteed to be reflexive via a blanket impl.
This is a minor ergonomic improvement which allows us to write:
instead of
when the type can be inferred, saving a grand total of 2 characters (3 if you count the space)!
This trick (ab)uses
From
as a stand-in for an identity trait. This is probably fine, because there is only one possible implementation of thefrom
method, which is the identity function, sinceFrom
is guaranteed to be reflexive via a blanket impl.