Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Fixed docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Feb 12, 2023
1 parent 56ab52a commit c21160d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion guide/src/low_level.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let x = vec![1u32, 2, 3];
let x: Buffer<u32> = x.into();
assert_eq!(x.as_slice(), &[1u32, 2, 3]);

let x = x.slice(1, 2); // O(1)
let x = x.sliced(1, 2); // O(1)
assert_eq!(x.as_slice(), &[2, 3]);
# }
```
Expand Down
5 changes: 3 additions & 2 deletions src/buffer/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ use super::IntoIter;
///
/// // cloning and slicing is `O(1)` (data is shared)
/// let mut buffer: Buffer<u32> = vec![1, 2, 3].into();
/// let slice = buffer.clone().slice(1, 1);
/// assert_eq!(slice.as_ref(), [2].as_ref());
/// let mut sliced = buffer.clone();
/// sliced.slice(1, 1);
/// assert_eq!(sliced.as_ref(), [2].as_ref());
/// // but cloning forbids getting mut since `slice` and `buffer` now share data
/// assert_eq!(buffer.get_mut(), None);
/// ```
Expand Down

0 comments on commit c21160d

Please sign in to comment.