diff --git a/build.rs b/build.rs index 94c9502b..0053d2ed 100644 --- a/build.rs +++ b/build.rs @@ -41,7 +41,7 @@ fn write_test(test_file: &mut File, test: &walkdir::DirEntry) { .expect("Should have .org extension") .replace("/", "_"); - if let Some(reason) = is_expect_fail(test_name.as_str()) { + if let Some(_reason) = is_expect_fail(test_name.as_str()) { write!(test_file, "#[ignore]\n").unwrap(); } write!( diff --git a/src/compare/diff.rs b/src/compare/diff.rs index 97aa6a46..11dfeb4a 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -222,7 +222,7 @@ fn compare_paragraph<'s>( rust: &'s Paragraph<'s>, ) -> Result> { let children = emacs.as_list()?; - let mut child_status = Vec::new(); + let child_status = Vec::new(); let mut this_status = DiffStatus::Good; let emacs_name = "paragraph"; if assert_name(emacs, emacs_name).is_err() { @@ -233,7 +233,7 @@ fn compare_paragraph<'s>( this_status = DiffStatus::Bad; } - for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) {} + for (_emacs_child, _rust_child) in children.iter().skip(2).zip(rust.children.iter()) {} Ok(DiffResult { status: this_status, @@ -396,8 +396,7 @@ fn compare_comment<'s>( emacs: &'s Token<'s>, rust: &'s Comment<'s>, ) -> Result> { - let children = emacs.as_list()?; - let mut child_status = Vec::new(); + let child_status = Vec::new(); let mut this_status = DiffStatus::Good; let emacs_name = "comment"; if assert_name(emacs, emacs_name).is_err() { @@ -451,7 +450,7 @@ fn compare_property_drawer<'s>( rust: &'s PropertyDrawer<'s>, ) -> Result> { let children = emacs.as_list()?; - let mut child_status = Vec::new(); + let child_status = Vec::new(); let mut this_status = DiffStatus::Good; let emacs_name = "property-drawer"; if assert_name(emacs, emacs_name).is_err() { @@ -462,7 +461,7 @@ fn compare_property_drawer<'s>( this_status = DiffStatus::Bad; } - for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) { + for (_emacs_child, _rust_child) in children.iter().skip(2).zip(rust.children.iter()) { // TODO: What are node properties and are they the only legal child of property drawers? // child_status.push(compare_element(source, emacs_child, rust_child)?); } @@ -539,7 +538,7 @@ fn compare_table_cell<'s>( rust: &'s TableCell<'s>, ) -> Result> { let children = emacs.as_list()?; - let mut child_status = Vec::new(); + let child_status = Vec::new(); let mut this_status = DiffStatus::Good; let emacs_name = "table-cell"; if assert_name(emacs, emacs_name).is_err() { @@ -550,7 +549,7 @@ fn compare_table_cell<'s>( this_status = DiffStatus::Bad; } - for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) {} + for (_emacs_child, _rust_child) in children.iter().skip(2).zip(rust.children.iter()) {} Ok(DiffResult { status: this_status, @@ -566,7 +565,7 @@ fn compare_verse_block<'s>( rust: &'s VerseBlock<'s>, ) -> Result> { let children = emacs.as_list()?; - let mut child_status = Vec::new(); + let child_status = Vec::new(); let mut this_status = DiffStatus::Good; let emacs_name = "verse-block"; if assert_name(emacs, emacs_name).is_err() { @@ -577,7 +576,7 @@ fn compare_verse_block<'s>( this_status = DiffStatus::Bad; } - for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) {} + for (_emacs_child, _rust_child) in children.iter().skip(2).zip(rust.children.iter()) {} Ok(DiffResult { status: this_status, diff --git a/src/compare/sexp.rs b/src/compare/sexp.rs index 8de70da9..01bf135c 100644 --- a/src/compare/sexp.rs +++ b/src/compare/sexp.rs @@ -1,5 +1,3 @@ -use crate::error::CustomError; -use crate::error::MyError; use crate::error::Res; use std::collections::HashMap; diff --git a/src/error/error.rs b/src/error/error.rs index eb239654..37e38045 100644 --- a/src/error/error.rs +++ b/src/error/error.rs @@ -18,7 +18,7 @@ impl ParseError for CustomError { CustomError::Nom(input, kind) } - fn append(_input: I, _kind: ErrorKind, mut other: Self) -> Self { + fn append(_input: I, _kind: ErrorKind, /*mut*/ other: Self) -> Self { // Doesn't do append like VerboseError other } diff --git a/src/parser/comment.rs b/src/parser/comment.rs index 5f6f4ec7..80d5651e 100644 --- a/src/parser/comment.rs +++ b/src/parser/comment.rs @@ -34,8 +34,8 @@ pub fn comment<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, let parser_context = context.with_additional_node(ContextElement::Context("comment")); let comment_line_matcher = parser_with_context!(comment_line)(&parser_context); let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context); - let (remaining, first_line) = comment_line_matcher(input)?; - let (remaining, remaining_lines) = + let (remaining, _first_line) = comment_line_matcher(input)?; + let (remaining, _remaining_lines) = many0(preceded(not(exit_matcher), comment_line_matcher))(remaining)?; let (remaining, _trailing_ws) = diff --git a/src/parser/document.rs b/src/parser/document.rs index 3555c579..28b4157a 100644 --- a/src/parser/document.rs +++ b/src/parser/document.rs @@ -1,5 +1,3 @@ -use crate::error::CustomError; -use crate::error::MyError; use crate::error::Res; use crate::parser::comment::comment; use crate::parser::element_parser::element; diff --git a/src/parser/element_parser.rs b/src/parser/element_parser.rs index f187ea36..b7cba56e 100644 --- a/src/parser/element_parser.rs +++ b/src/parser/element_parser.rs @@ -12,8 +12,6 @@ use super::lesser_block::verse_block; use super::paragraph::paragraph; use super::plain_list::plain_list; use super::Context; -use crate::error::CustomError; -use crate::error::MyError; use crate::error::Res; use crate::parser::parser_with_context::parser_with_context; use crate::parser::table::org_mode_table; diff --git a/src/parser/lesser_block.rs b/src/parser/lesser_block.rs index c202fdab..7bbdaccf 100644 --- a/src/parser/lesser_block.rs +++ b/src/parser/lesser_block.rs @@ -1,5 +1,3 @@ -use crate::error::CustomError; -use crate::error::MyError; use crate::error::Res; use nom::branch::alt; use nom::bytes::complete::is_not; diff --git a/src/parser/object_parser.rs b/src/parser/object_parser.rs index 1f774bcf..a6ce342d 100644 --- a/src/parser/object_parser.rs +++ b/src/parser/object_parser.rs @@ -1,5 +1,3 @@ -use crate::error::CustomError; -use crate::error::MyError; use crate::error::Res; use nom::combinator::map; use nom::combinator::not; diff --git a/src/parser/paragraph.rs b/src/parser/paragraph.rs index 61a4ec10..b722856d 100644 --- a/src/parser/paragraph.rs +++ b/src/parser/paragraph.rs @@ -1,5 +1,3 @@ -use crate::error::CustomError; -use crate::error::MyError; use crate::error::Res; use nom::branch::alt; use nom::combinator::eof; diff --git a/src/parser/plain_list.rs b/src/parser/plain_list.rs index 1b6745f2..9f159337 100644 --- a/src/parser/plain_list.rs +++ b/src/parser/plain_list.rs @@ -122,7 +122,7 @@ pub fn plain_list<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s s return Err(nom::Err::Error(CustomError::MyError(MyError( "Should be unreachable.", )))); - unreachable!(); + // unreachable!(); } }; } diff --git a/src/parser/property_drawer.rs b/src/parser/property_drawer.rs index 6eb5832c..fb347f86 100644 --- a/src/parser/property_drawer.rs +++ b/src/parser/property_drawer.rs @@ -41,7 +41,7 @@ pub fn property_drawer<'r, 's>( } let ( remaining, - (_start_of_line, _leading_whitespace, open_tag, _trailing_whitespace, _line_ending), + (_start_of_line, _leading_whitespace, _open_tag, _trailing_whitespace, _line_ending), ) = tuple(( parser_with_context!(start_of_line)(context), space0, @@ -87,7 +87,7 @@ fn node_property<'r, 's>( context: Context<'r, 's>, input: &'s str, ) -> Res<&'s str, NodeProperty<'s>> { - let (remaining, (_start_of_line, _leading_whitespace, _open_colon, name, _close_colon)) = + let (remaining, (_start_of_line, _leading_whitespace, _open_colon, _name, _close_colon)) = tuple(( parser_with_context!(start_of_line)(context), space0, diff --git a/src/parser/table.rs b/src/parser/table.rs index 263590c9..0ac55f3f 100644 --- a/src/parser/table.rs +++ b/src/parser/table.rs @@ -1,5 +1,3 @@ -use crate::error::CustomError; -use crate::error::MyError; use crate::error::Res; use nom::branch::alt; use nom::bytes::complete::is_not;