From 8ec4743cab1ac21f61229ad933061dac089b8aa1 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Mon, 18 Sep 2023 00:26:47 -0500 Subject: [PATCH] Remove unnecessary constraints from FilePtr impls Fixes jam1garner/binrw#218. --- binrw/src/file_ptr.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/binrw/src/file_ptr.rs b/binrw/src/file_ptr.rs index fa976d2a..7f48ade3 100644 --- a/binrw/src/file_ptr.rs +++ b/binrw/src/file_ptr.rs @@ -185,7 +185,10 @@ where } } -impl Deref for FilePtr { +impl Deref for FilePtr +where + Ptr: IntoSeekFrom, +{ type Target = Value; fn deref(&self) -> &Self::Target { @@ -193,7 +196,10 @@ impl Deref for FilePtr { } } -impl DerefMut for FilePtr { +impl DerefMut for FilePtr +where + Ptr: IntoSeekFrom, +{ fn deref_mut(&mut self) -> &mut Value { &mut self.value } @@ -201,7 +207,7 @@ impl DerefMut for FilePtr { impl PartialEq> for FilePtr where - Ptr: PartialEq + IntoSeekFrom, + Ptr: IntoSeekFrom, Value: PartialEq, { fn eq(&self, other: &Self) -> bool {