NLnetLabs / domain

A DNS library for Rust.
https://nlnetlabs.nl/projects/domain/about/
BSD 3-Clause "New" or "Revised" License
332 stars 56 forks source link

Remove `SerializeOctets` bounds #344

Open tertsdiepraam opened 1 month ago

tertsdiepraam commented 1 month ago

In its current version, this needs to be paired with a new function in octseq: https://github.com/NLnetLabs/octseq/pull/57.

This makes the bounds more clear. It's a breaking change in a few places where only SerializeOctets was specified and not AsRef<[u8]>, altough everything that implements SerializeOctets already implements AsRef<[u8]>, because AsRef<[u8]> is a supertrait of Octets, so fixing the bounds is easy.

I also think that this conceptually simplifies the serialization: we only need to look at the octets to serialize them, that functionality does not need to differ between the types.

Marking as draft because we should first land the other PR in octseq.