Skip to content

Commit

Permalink
[wip] Implement Ref cast methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jswrenn committed Dec 12, 2024
1 parent 2c8ef74 commit e6a23ae
Show file tree
Hide file tree
Showing 2 changed files with 376 additions and 64 deletions.
14 changes: 0 additions & 14 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,6 @@ impl<Src, Dst: ?Sized> SizeError<Src, Dst> {
self.src
}

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

/// Maps the source value associated with the conversion error.
///
/// This can help mitigate [issues with `Send`, `Sync` and `'static`
Expand Down Expand Up @@ -683,15 +678,6 @@ impl<Src, Dst: ?Sized> CastError<Src, Dst> {
}
}

/// Sets the source value associated with the conversion error.
pub(crate) fn with_src<NewSrc>(self, new_src: NewSrc) -> CastError<NewSrc, Dst> {
match self {
Self::Alignment(e) => CastError::Alignment(e.with_src(new_src)),
Self::Size(e) => CastError::Size(e.with_src(new_src)),
Self::Validity(i) => match i {},
}
}

/// Maps the source value associated with the conversion error.
///
/// This can help mitigate [issues with `Send`, `Sync` and `'static`
Expand Down
Loading

0 comments on commit e6a23ae

Please sign in to comment.