Skip to content

Commit 383b042

Browse files
committed
Tweaking some docs.
1 parent e26c0f8 commit 383b042

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/raw.rs

+5-9
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ use cfg_if::cfg_if;
6464
/// For instance, a valid progmem statics would be one, that is attributed with
6565
/// `#[link_section = ".progmem.data"]`.
6666
///
67-
/// Also general Rust pointer dereferencing constraints apply, i.e. it must not
68-
/// be dangling.
67+
/// Also general Rust pointer dereferencing constraints apply (see [`core::ptr::read`]).
6968
///
7069
/// [`read_slice`]: fn.read_slice.html
7170
/// [`read_value`]: fn.read_value.html
@@ -305,10 +304,7 @@ where
305304
/// whether the `lpm-asm-loop` crate feature is set or not.
306305
///
307306
/// Notice that `T` might be also something like `[T, N]` so that in fact
308-
/// entire arrays can be loaded using this function. Alternatively if the the
309-
/// size of an array can not be known at compile time (i.e. a slice) there is
310-
/// also the [`read_slice`] function, but it requires proper
311-
/// initialization upfront.
307+
/// entire arrays can be loaded using this function.
312308
///
313309
/// If you need to read just a single byte you might use [`read_byte`].
314310
///
@@ -369,7 +365,7 @@ where
369365
///
370366
/// # Safety
371367
///
372-
/// This call is analog to `core::ptr::copy` thus it
368+
/// This call is analog to [`core::ptr::copy`] thus it
373369
/// has the same basic requirements such as the pointer must be valid for
374370
/// dereferencing i.e. not dangling and the pointer must
375371
/// be valid to read one entire value of type `T`,
@@ -379,7 +375,7 @@ where
379375
/// domain.
380376
///
381377
/// While the alignment is not strictly required for AVR, the non-AVR fallback
382-
/// might be done actually use `core::ptr::copy` and therefore the pointers
378+
/// might be actually using `core::ptr::copy` and therefore the pointers
383379
/// must be aligned.
384380
///
385381
/// [`read_byte`]: fn.read_byte.html
@@ -391,7 +387,7 @@ where
391387
T: Sized + Copy,
392388
{
393389
// The use of an MaybeUninit allows us to correctly allocate the space
394-
// required to hold one `T`, whereas we correctly comunicate that it is
390+
// required to hold one `T`, whereas we correctly communicate that it is
395391
// uninitialized to the compiler.
396392
//
397393
// The alternative of using a [0u8; size_of::<T>()] is actually much more

src/string.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,7 @@ impl<const N: usize> PmString<N> {
403403
/// # Safety
404404
///
405405
/// This function is only sound to call, if the value is
406-
/// stored in a static that is for instance attributed with
407-
/// `#[link_section = ".progmem.data"]`.
408-
///
409-
/// The give byte array must contain valid UTF-8.
406+
/// is a valid `ProgMem`, and the underlying byte array contains valid UTF-8.
410407
pub const unsafe fn new(pm: ProgMem<[u8; N]>) -> Self {
411408
// SAFETY: the caller ensures that the bytes are valid UTF-8
412409
Self {

0 commit comments

Comments
 (0)