Skip to content

Restore base64::{encode, decode} functions #213

Closed
@rillian

Description

@rillian

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions