impl Debug for UtPex

This commit is contained in:
Igor Katson 2024-08-25 13:20:13 +01:00
parent 90bfb85bcc
commit c7b7dc300f
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 43 additions and 19 deletions

View file

@ -186,7 +186,7 @@ impl From<anyhow::Error> for MessageDeserializeError {
}
#[derive(Debug)]
pub enum Message<ByteBuf: std::hash::Hash + Eq> {
pub enum Message<ByteBuf: std::hash::Hash + Eq + AsRef<[u8]>> {
Request(Request),
Cancel(Request),
Bitfield(ByteBuf),
@ -212,8 +212,8 @@ pub struct Bitfield<'a> {
impl<ByteBuf> CloneToOwned for Message<ByteBuf>
where
ByteBuf: CloneToOwned + std::hash::Hash + Eq,
<ByteBuf as CloneToOwned>::Target: std::hash::Hash + Eq,
ByteBuf: CloneToOwned + std::hash::Hash + Eq + AsRef<[u8]>,
<ByteBuf as CloneToOwned>::Target: std::hash::Hash + Eq + AsRef<[u8]>,
{
type Target = Message<<ByteBuf as CloneToOwned>::Target>;