fn peek(&mut self, off: usize) -> Option<char> {
        // If the requested offset lies outside the chunk of the file that is
        // currently in memory, refill the buffer first.
        let idx = self.pos + off;
        if idx >= self.tail {
            self.refill(idx + 1)
        }

        // The previous call to refill may move things around in the buffer, so
        // the index needs to be recalculated. If it lies beyond what we were
        // able to read from the file, as indicated by `self.tail`, return
        // `None` to indicate the end of the file.
        let idx = self.pos + off;
        if idx < self.tail {
            Some(self.buf[idx] as char)
        } else {
            None
        }
    }
/// Return the value of the byte that is `off` bytes away from the current
/// position in the input file. If the `off` lies beyond the end of file,
/// `None` is returned.
Return the value of the byte that is `off` bytes away from the current
position in the input file. If the `off` lies beyond the end of file,
`None` is returned.
Return the value of the byte that is ` off ` bytes away from the current position in the input file . If the ` off ` lies beyond the end of file ` None ` is returned .
fn peek(&mut self, off: usize) -> Option<char> {
        // If the requested offset lies outside the chunk of the file that is
        // currently in memory, refill the buffer first.
        let idx = self.pos + off;
        if idx >= self.tail {
            self.refill(idx + 1)
        }
        // The previous call to refill may move things around in the buffer, so
        // the index needs to be recalculated. If it lies beyond what we were
        // able to read from the file, as indicated by `self.tail`, return
        // `None` to indicate the end of the file.
        let idx = self.pos + off;
        if idx < self.tail {
            Some(self.buf[idx] as char)
        } else {
            None
        }
    }
fn peek ( & mut self , off : usize ) -> Option < char > { // If the requested offset lies outside the chunk of the file that is // currently in memory, refill the buffer first. let idx = self . pos + off ; if idx >= self . tail { self . refill ( idx + 1 ) } // The previous call to refill may move things around in the buffer, so // the index needs to be recalculated. If it lies beyond what we were // able to read from the file, as indicated by `self.tail`, return // `None` to indicate the end of the file. let idx = self . pos + off ; if idx < self . tail { Some ( self . buf [ idx ] as char ) } else { None } }
Return the value of the byte that is `off` bytes away from the current
position in the input file.
Return the value of the byte that is ` off ` bytes away from the current position in the input file .
&mut self
off
usize
&mut self
off
usize