clarify results of misusing cursors

This commit is contained in:
Ian Jackson 2023-03-01 15:57:14 +00:00 committed by Nick Mathewson
parent 53e44b58f5
commit bab32c6038
1 changed files with 2 additions and 2 deletions

View File

@ -335,8 +335,8 @@ impl<'a> Reader<'a> {
/// If the cursors are not in order, return an empty slice.
///
/// This function is guaranteed not to panic if the inputs were generated
/// from a different Reader, but the byte slice that it returns will
/// not be well-defined.
/// from a different Reader, but if so the byte slice that it returns will
/// not be meaningful.
pub fn range(&self, start: Cursor<'a>, end: Cursor<'a>) -> &'a [u8] {
if start.pos <= end.pos && end.pos <= self.b.len() {
&self.b[start.pos..end.pos]