diff --git a/src/error.rs b/src/error.rs index 729102727d..39b2a864bf 100644 --- a/src/error.rs +++ b/src/error.rs @@ -298,7 +298,7 @@ impl AlignmentError { /// }); /// ``` #[inline] - pub fn map_src(self, f: impl Fn(Src) -> NewSrc) -> AlignmentError { + pub fn map_src(self, f: impl FnOnce(Src) -> NewSrc) -> AlignmentError { AlignmentError { src: f(self.src), dst: SendSyncPhantomData::default() } } @@ -453,7 +453,7 @@ impl SizeError { /// }); /// ``` #[inline] - pub fn map_src(self, f: impl Fn(Src) -> NewSrc) -> SizeError { + pub fn map_src(self, f: impl FnOnce(Src) -> NewSrc) -> SizeError { SizeError { src: f(self.src), dst: SendSyncPhantomData::default() } } @@ -590,7 +590,7 @@ impl ValidityError { /// }); /// ``` #[inline] - pub fn map_src(self, f: impl Fn(Src) -> NewSrc) -> ValidityError { + pub fn map_src(self, f: impl FnOnce(Src) -> NewSrc) -> ValidityError { ValidityError { src: f(self.src), dst: SendSyncPhantomData::default() } } @@ -710,7 +710,7 @@ impl CastError { /// }); /// ``` #[inline] - pub fn map_src(self, f: impl Fn(Src) -> NewSrc) -> CastError { + pub fn map_src(self, f: impl FnOnce(Src) -> NewSrc) -> CastError { match self { Self::Alignment(e) => CastError::Alignment(e.map_src(f)), Self::Size(e) => CastError::Size(e.map_src(f)), @@ -831,7 +831,7 @@ impl TryCastError { /// }); /// ``` #[inline] - pub fn map_src(self, f: impl Fn(Src) -> NewSrc) -> TryCastError { + pub fn map_src(self, f: impl FnOnce(Src) -> NewSrc) -> TryCastError { match self { Self::Alignment(e) => TryCastError::Alignment(e.map_src(f)), Self::Size(e) => TryCastError::Size(e.map_src(f)), @@ -896,7 +896,7 @@ impl TryReadError { /// }); /// ``` #[inline] - pub fn map_src(self, f: impl Fn(Src) -> NewSrc) -> TryReadError { + pub fn map_src(self, f: impl FnOnce(Src) -> NewSrc) -> TryReadError { match self { Self::Alignment(i) => match i {}, Self::Size(e) => TryReadError::Size(e.map_src(f)),