Skip to content

Commit

Permalink
Implement TryFromBytes::try_{mut,ref}_from_{prefix,suffix}
Browse files Browse the repository at this point in the history
Makes progress towards #5
  • Loading branch information
jswrenn committed May 8, 2024
1 parent f405033 commit 2c41fef
Show file tree
Hide file tree
Showing 2 changed files with 533 additions and 46 deletions.
5 changes: 0 additions & 5 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,6 @@ impl<Src, Dst: ?Sized + TryFromBytes> ValidityError<Src, Dst> {
self.src
}

/// Sets the source value associated with the conversion error.
pub(crate) fn with_src<NewSrc>(self, new_src: NewSrc) -> ValidityError<NewSrc, Dst> {
ValidityError { src: new_src, dst: PhantomData }
}

/// Maps the source value associated with the conversion error.
pub(crate) fn map_src<NewSrc>(self, f: impl Fn(Src) -> NewSrc) -> ValidityError<NewSrc, Dst> {
ValidityError { src: f(self.src), dst: PhantomData }
Expand Down

0 comments on commit 2c41fef

Please sign in to comment.