From 0532238ce0666cd1aa0cf3f7b4c3d520b84d9f34 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Thu, 10 Apr 2025 17:02:43 +0100 Subject: [PATCH] Fix documentation of fns rand_core::le::read_u*_into --- rand_core/src/.le.rs.kate-swp | Bin 0 -> 218 bytes rand_core/src/le.rs | 11 +++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 rand_core/src/.le.rs.kate-swp diff --git a/rand_core/src/.le.rs.kate-swp b/rand_core/src/.le.rs.kate-swp new file mode 100644 index 0000000000000000000000000000000000000000..0debd30bbe9b6d43d4c68b0d104866453286822f GIT binary patch literal 218 zcmXAiF$%&!5JeYK*@~pGaI~<}M67KiNDPV*Vwp{LBMWObY&HbJ%0qYyZy64IVGuvJ>ZI#@BrMml*s--G0HRP#+1f7ST>x}+I?CWyDg0|@01h9R6J z7cF$HguQZ3%Vksx#cL?;IBu+vb^%;#)2sRljj@gw=(4i0Ms%f9rUp|%E?Sq91ZbBe dQ-tD^q_XA){J+_1Rmy<6RPm`hLnt10qaUAzHNF4< literal 0 HcmV?d00001 diff --git a/rand_core/src/le.rs b/rand_core/src/le.rs index cee84c2f327..6c4d7c82ad0 100644 --- a/rand_core/src/le.rs +++ b/rand_core/src/le.rs @@ -11,11 +11,14 @@ //! Little-Endian order has been chosen for internal usage; this makes some //! useful functions available. -/// Reads unsigned 32 bit integers from `src` into `dst`. +/// Fills `dst: &mut [u32]` from `src` +/// +/// Reads use Little-Endian byte order, allowing portable reproduction of `dst` +/// from a byte slice. /// /// # Panics /// -/// If `dst` has insufficient space (`4*dst.len() < src.len()`). +/// If `src` has insufficient length (if `src.len() < 4*dst.len()`). #[inline] #[track_caller] pub fn read_u32_into(src: &[u8], dst: &mut [u32]) { @@ -25,11 +28,11 @@ pub fn read_u32_into(src: &[u8], dst: &mut [u32]) { } } -/// Reads unsigned 64 bit integers from `src` into `dst`. +/// Fills `dst: &mut [u64]` from `src` /// /// # Panics /// -/// If `dst` has insufficient space (`8*dst.len() < src.len()`). +/// If `src` has insufficient length (if `src.len() < 8*dst.len()`). #[inline] #[track_caller] pub fn read_u64_into(src: &[u8], dst: &mut [u64]) {