diff options
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/owned_slice.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_data_structures/src/owned_slice.rs b/compiler/rustc_data_structures/src/owned_slice.rs index 146f06a1c69..e35a93f2a1d 100644 --- a/compiler/rustc_data_structures/src/owned_slice.rs +++ b/compiler/rustc_data_structures/src/owned_slice.rs @@ -59,7 +59,7 @@ pub struct OwnedSlice { pub fn slice_owned<O, F>(owner: O, slicer: F) -> OwnedSlice where O: Send + Sync + 'static, - F: Fn(&O) -> &[u8], + F: FnOnce(&O) -> &[u8], { try_slice_owned(owner, |x| Ok::<_, !>(slicer(x))).into_ok() } @@ -70,7 +70,7 @@ where pub fn try_slice_owned<O, F, E>(owner: O, slicer: F) -> Result<OwnedSlice, E> where O: Send + Sync + 'static, - F: Fn(&O) -> Result<&[u8], E>, + F: FnOnce(&O) -> Result<&[u8], E>, { // We box the owner of the bytes, so it doesn't move. // |
