Skip to content

Breaking change wish list #72

Open
@ia0

Description

@ia0

This issue lists breaking changes that could be worth doing. Since they would bump the major version, doing as much of them simultaneously would be best. The next release is v3: #106.

static instead of const (v3)

Using const prevents users to take long-term references, which is needed for Encoder. The constants should instead be statics.

const fn

This crate is mostly made of pure terminating functions (e.g. encode_len(), encode_mut(), decode_len(), and decode_mut()). Those functions should be const fn. This would replace the data-encoding-macro library which is currently working around the const fn limitations of Rust.

This is blocked by const fn support in Rust: meta tracking issue.

Private Encoding implementation (v3)

It should now be possible to make the Encoding implementation private and provide an unsafe const fn for data-encoding-macro to use.

MaybeUninit (v3)

Most output parameters are not read from but currently use &mut [u8] which requires them to be initialized. Those functions could instead take &mut [MaybeUninit<u8>].

This is mostly blocked by maybe_uninit_slice.

MSRV (v3)

Even if not necessary, bumping to the latest stable might give access to features that may be useful for future minor or patch versions. This is strictly speaking not a breaking change to bump MSRV (discussion), but it's nice to do it during a major bump. By discussion in #77 it would be nice to have the MSRV at rustc in Debian oldstable. This should cover most common distributions. Note also the trick to use syn = ">= 2, < 4" when multiple major versions are supported for a dependency.

If we use 1.84, then maybe MSRV won't be an issue anymore and can be bumped as a minor change.

Expose the polymorphic implementation

Currently only the type-erased API with internal dispatch is exposed. This may prevent dead-code elimination to trigger if encodings are not statically known, resulting in bigger binary size. As an alternative, the internal polymorphic API could be exposed.

This might be blocked by good const generics support in Rust.

Do not panic (v3)

We should let the user choose what to do in case of errors (even failed preconditions) by returning an error, see #126.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions