tychedelia / kafka-protocol-rs

Rust Kafka protocol
Apache License 2.0
63 stars 23 forks source link

Remove `EncodeError`/`DecodeError` aliases #69

Closed Hackzzila closed 4 months ago

Hackzzila commented 4 months ago

In my opinion, the aliases EncodeError and DecodeError can be confusing if you are skimming the docs. For the longest time I assumed they were a custom type, not both aliases for anyhow::Error. This also is confusing when rust-analyzer seems to pretend those types don't exist (well, because they don't). I think it is more clear to just use anyhow::Result or anyhow::Error explicitly.

Hackzzila commented 4 months ago

That is a fair point. Could also change them from re-exports to type aliases so it is more clear in the docs.

rukai commented 4 months ago

using anyhow directly is good if we think it's likely we won't want a custom error type in the future.