librustc_lexer: Make nth_char method private

This commit is contained in:
Igor Aleksanov 2019-11-03 12:57:59 +03:00
parent e8b8d2a725
commit 31735b02c9

View file

@ -41,7 +41,7 @@ impl<'a> Cursor<'a> {
/// If requested position doesn't exist, `EOF_CHAR` is returned.
/// However, getting `EOF_CHAR` doesn't always mean actual end of file,
/// it should be checked with `is_eof` method.
pub(crate) fn nth_char(&self, n: usize) -> char {
fn nth_char(&self, n: usize) -> char {
self.chars().nth(n).unwrap_or(EOF_CHAR)
}