Skip to content

Commit 9dbc3bd

Browse files
committed
Clarify that AlignedCursor is about padding
as opposed to aligning the start of the vector, or items within the vector
1 parent 9683f51 commit 9dbc3bd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

epserde/src/utils/aligned_cursor.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ use mem_dbg::{MemDbg, MemSize};
1313
/// An aligned version of [`Cursor`](std::io::Cursor).
1414
///
1515
/// The standard library implementation of a [cursor](std::io::Cursor) is not
16-
/// aligned, and thus cannot be used to create examples or unit tests for
17-
/// ε-serde. This version has a [settable alignment](maligned::Alignment) that
18-
/// is guaranteed to be respected by the underlying storage.
16+
/// aligned, meaning that its length is exactly the number of bytes written.
17+
/// Thus cannot be used to create examples or unit tests for ε-serde.
18+
/// This version has a [settable alignment](maligned::Alignment) that
19+
/// is guaranteed to be respected by the underlying storage, by adding padding
20+
/// bytes at the end of the underlying vector.
1921
///
2022
/// Note that length and position are stored as `usize` values, so the maximum
2123
/// length and position are `usize::MAX`. This is different from

0 commit comments

Comments
 (0)