Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added rand_core/src/.le.rs.kate-swp
Binary file not shown.
11 changes: 7 additions & 4 deletions rand_core/src/le.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand All @@ -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]) {
Expand Down