There aren't two traits. There is one trait which is exported under several interchangeable names. This is far from unique. Virtually everything in core
is also exported from std
, and virtually always under exactly the same path (i.e., you can just replace the "core" prefix with "std").
As for which one you should use: If you have a reason to not link to the standard library (#![no_std]
), then the std::*
one isn't available so obviously you use core::*
. If on the other hand you do use the standard library, you should use the std::*
re-export. It is more customary and requires less typing.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…