Skip to content

Commit

Permalink
Remove unnecessary constraints from FilePtr impls
Browse files Browse the repository at this point in the history
Fixes #218.
  • Loading branch information
csnover committed Sep 19, 2023
1 parent 13525e3 commit 8ec4743
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions binrw/src/file_ptr.rs
Expand Up @@ -185,23 +185,29 @@ where
}
}

impl<Ptr: IntoSeekFrom, Value: BinRead> Deref for FilePtr<Ptr, Value> {
impl<Ptr, Value> Deref for FilePtr<Ptr, Value>
where
Ptr: IntoSeekFrom,
{
type Target = Value;

fn deref(&self) -> &Self::Target {
&self.value
}
}

impl<Ptr: IntoSeekFrom, Value: BinRead> DerefMut for FilePtr<Ptr, Value> {
impl<Ptr, Value> DerefMut for FilePtr<Ptr, Value>
where
Ptr: IntoSeekFrom,
{
fn deref_mut(&mut self) -> &mut Value {
&mut self.value
}
}

impl<Ptr, Value> PartialEq<FilePtr<Ptr, Value>> for FilePtr<Ptr, Value>
where
Ptr: PartialEq + IntoSeekFrom,
Ptr: IntoSeekFrom,
Value: PartialEq,
{
fn eq(&self, other: &Self) -> bool {
Expand Down

0 comments on commit 8ec4743

Please sign in to comment.