Fix warnings for Rust 1.51 (#3214)

* Fix warnings for Rust 1.51

* More fixes

* More fixes
This commit is contained in:
Jonathan Turner
2021-03-26 21:26:57 +13:00
committed by GitHub
parent 589fc0b8ad
commit 7e184b58b2
55 changed files with 325 additions and 400 deletions

View File

@ -360,12 +360,12 @@ pub fn parse_block(tokens: Vec<Token>) -> (LiteBlock, Option<ParseError>) {
// - semicolon
while let Some(token) = tokens.next() {
match &token.contents {
TokenContents::EOL => {
TokenContents::Eol => {
// If we encounter two newline characters in a row, use a special eoleol event,
// which allows the parser to discard comments that shouldn't be treated as
// documentation for the following item.
if let Some(Token {
contents: TokenContents::EOL,
contents: TokenContents::Eol,
..
}) = tokens.peek()
{
@ -480,7 +480,7 @@ pub fn lex(input: &str, span_offset: usize) -> (Vec<Token>, Option<ParseError>)
let idx = *idx;
let _ = char_indices.next();
output.push(Token::new(
TokenContents::EOL,
TokenContents::Eol,
Span::new(span_offset + idx, span_offset + idx + 1),
));
} else if *c == '#' {

View File

@ -19,7 +19,7 @@ pub enum TokenContents {
Comment(LiteComment),
Pipe,
Semicolon,
EOL,
Eol,
}
impl fmt::Display for TokenContents {
@ -29,7 +29,7 @@ impl fmt::Display for TokenContents {
TokenContents::Comment(comm) => write!(f, "{}", comm),
TokenContents::Pipe => write!(f, "|"),
TokenContents::Semicolon => write!(f, ";"),
TokenContents::EOL => write!(f, "\\n"),
TokenContents::Eol => write!(f, "\\n"),
}
}
}