Skip to content

Commit

Permalink
Fixed logical errors in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Le0X8 committed Oct 3, 2024
1 parent deda141 commit 67ae62b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ pub fn write_new(len: u64) -> WData {
///
/// rw.write_u8(8).unwrap();
///
/// assert_eq!(rw.read_bytes_at(0, 8).unwrap(), vec![0, 1, 2, 3, 4, 5, 6, 7]);
/// assert_eq!(rw.read_bytes_at(0, 8).unwrap(), vec![8, 1, 2, 3, 4, 5, 6, 7]);
/// rw.rw_close(); // we don't need the data back
/// ```
pub fn rw(data: Vec<u8>) -> RwData {
Expand Down
4 changes: 2 additions & 2 deletions src/data/ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl<'a> From<RwRefData<'a>> for ClosableMutData<'a> {
/// use dh::recommended::*;
///
/// let data = vec![0, 1, 2, 3, 4, 5, 6, 7];
/// let mut reader = data::read(&data);
/// let mut reader = dh::data::read_ref(&data);
///
/// assert_eq!(reader.read_u8_at(0).unwrap(), 0);
/// ```
Expand Down Expand Up @@ -325,7 +325,7 @@ pub fn write(data: &mut Vec<u8>) -> WRefData {
/// rw.write_u16be(0x1234).unwrap();
/// assert_eq!(rw.read_u16be_at(0).unwrap(), 0x1234);
///
/// rw.close().unwrap(); // removes the mutable reference
/// rw.rw_close().unwrap(); // removes the mutable reference
/// ```
pub fn rw(data: &mut Vec<u8>) -> RwRefData {
RwRefData { data, pos: 0 }
Expand Down

0 comments on commit 67ae62b

Please sign in to comment.