Description
This is a request to restore the base64::encode
and base64::decode
convenience functions deprecated in the 0.21.0 release.
Normally I agree with explicit being better than implicit, but I don't see the harm here. If there's no specific interoperability requirements, explicitly choosing a configuration isn't particularly important. For quick scripts, adding all of
// Import the base64 crate Engine trait anonymously so we can
// call its methods without adding to the namespace.
use base64::engine::Engine as _;
use base64::engine::general_purpose::STANDARD as BASE64;
at the top of the file and then calling BASE64.encode()
is more cognitive load. With the new API I have to think about the trait, the current namespace, and why I'm calling a method on a constant. That's being explicit about the crate's implementation choices, not just the base64 variant.
In contrast, when I see a bare base64::encode()
its clear some base64 implementation is being called to encode something in the default config, which is good enough a lot of the time.