From f38cb4706a55d260a4fdee8754f05f42c8864fe9 Mon Sep 17 00:00:00 2001 From: Adrien Burgun Date: Sun, 10 Jul 2022 22:41:57 +0200 Subject: [PATCH] :pencil: Complete documentation of borrow_range --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 757304b..707cd09 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -352,6 +352,9 @@ impl VecCell { /// vec.push(3); /// /// let s = vec.borrow_range(0..2).unwrap(); // Gets elements 0 and 1 + /// assert_eq!(s[0], 1); + /// assert_eq!(s[1], 2); + /// assert!(s.get(2).is_none()); /// ``` pub fn borrow_range<'b, R: std::ops::RangeBounds>(&'b self, range: R) -> Option> { VecRef::from_range(self, range)