Solve the rest of the compiler warnings.
This commit is contained in:
parent
a1724dae52
commit
18323a2b43
2
build.rs
2
build.rs
@ -41,7 +41,7 @@ fn write_test(test_file: &mut File, test: &walkdir::DirEntry) {
|
|||||||
.expect("Should have .org extension")
|
.expect("Should have .org extension")
|
||||||
.replace("/", "_");
|
.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!(test_file, "#[ignore]\n").unwrap();
|
||||||
}
|
}
|
||||||
write!(
|
write!(
|
||||||
|
@ -222,7 +222,7 @@ fn compare_paragraph<'s>(
|
|||||||
rust: &'s Paragraph<'s>,
|
rust: &'s Paragraph<'s>,
|
||||||
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
||||||
let children = emacs.as_list()?;
|
let children = emacs.as_list()?;
|
||||||
let mut child_status = Vec::new();
|
let child_status = Vec::new();
|
||||||
let mut this_status = DiffStatus::Good;
|
let mut this_status = DiffStatus::Good;
|
||||||
let emacs_name = "paragraph";
|
let emacs_name = "paragraph";
|
||||||
if assert_name(emacs, emacs_name).is_err() {
|
if assert_name(emacs, emacs_name).is_err() {
|
||||||
@ -233,7 +233,7 @@ fn compare_paragraph<'s>(
|
|||||||
this_status = DiffStatus::Bad;
|
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 {
|
Ok(DiffResult {
|
||||||
status: this_status,
|
status: this_status,
|
||||||
@ -396,8 +396,7 @@ fn compare_comment<'s>(
|
|||||||
emacs: &'s Token<'s>,
|
emacs: &'s Token<'s>,
|
||||||
rust: &'s Comment<'s>,
|
rust: &'s Comment<'s>,
|
||||||
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
||||||
let children = emacs.as_list()?;
|
let child_status = Vec::new();
|
||||||
let mut child_status = Vec::new();
|
|
||||||
let mut this_status = DiffStatus::Good;
|
let mut this_status = DiffStatus::Good;
|
||||||
let emacs_name = "comment";
|
let emacs_name = "comment";
|
||||||
if assert_name(emacs, emacs_name).is_err() {
|
if assert_name(emacs, emacs_name).is_err() {
|
||||||
@ -451,7 +450,7 @@ fn compare_property_drawer<'s>(
|
|||||||
rust: &'s PropertyDrawer<'s>,
|
rust: &'s PropertyDrawer<'s>,
|
||||||
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
||||||
let children = emacs.as_list()?;
|
let children = emacs.as_list()?;
|
||||||
let mut child_status = Vec::new();
|
let child_status = Vec::new();
|
||||||
let mut this_status = DiffStatus::Good;
|
let mut this_status = DiffStatus::Good;
|
||||||
let emacs_name = "property-drawer";
|
let emacs_name = "property-drawer";
|
||||||
if assert_name(emacs, emacs_name).is_err() {
|
if assert_name(emacs, emacs_name).is_err() {
|
||||||
@ -462,7 +461,7 @@ fn compare_property_drawer<'s>(
|
|||||||
this_status = DiffStatus::Bad;
|
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?
|
// 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)?);
|
// child_status.push(compare_element(source, emacs_child, rust_child)?);
|
||||||
}
|
}
|
||||||
@ -539,7 +538,7 @@ fn compare_table_cell<'s>(
|
|||||||
rust: &'s TableCell<'s>,
|
rust: &'s TableCell<'s>,
|
||||||
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
||||||
let children = emacs.as_list()?;
|
let children = emacs.as_list()?;
|
||||||
let mut child_status = Vec::new();
|
let child_status = Vec::new();
|
||||||
let mut this_status = DiffStatus::Good;
|
let mut this_status = DiffStatus::Good;
|
||||||
let emacs_name = "table-cell";
|
let emacs_name = "table-cell";
|
||||||
if assert_name(emacs, emacs_name).is_err() {
|
if assert_name(emacs, emacs_name).is_err() {
|
||||||
@ -550,7 +549,7 @@ fn compare_table_cell<'s>(
|
|||||||
this_status = DiffStatus::Bad;
|
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 {
|
Ok(DiffResult {
|
||||||
status: this_status,
|
status: this_status,
|
||||||
@ -566,7 +565,7 @@ fn compare_verse_block<'s>(
|
|||||||
rust: &'s VerseBlock<'s>,
|
rust: &'s VerseBlock<'s>,
|
||||||
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
) -> Result<DiffResult, Box<dyn std::error::Error>> {
|
||||||
let children = emacs.as_list()?;
|
let children = emacs.as_list()?;
|
||||||
let mut child_status = Vec::new();
|
let child_status = Vec::new();
|
||||||
let mut this_status = DiffStatus::Good;
|
let mut this_status = DiffStatus::Good;
|
||||||
let emacs_name = "verse-block";
|
let emacs_name = "verse-block";
|
||||||
if assert_name(emacs, emacs_name).is_err() {
|
if assert_name(emacs, emacs_name).is_err() {
|
||||||
@ -577,7 +576,7 @@ fn compare_verse_block<'s>(
|
|||||||
this_status = DiffStatus::Bad;
|
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 {
|
Ok(DiffResult {
|
||||||
status: this_status,
|
status: this_status,
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use crate::error::CustomError;
|
|
||||||
use crate::error::MyError;
|
|
||||||
use crate::error::Res;
|
use crate::error::Res;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ impl<I> ParseError<I> for CustomError<I> {
|
|||||||
CustomError::Nom(input, kind)
|
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
|
// Doesn't do append like VerboseError
|
||||||
other
|
other
|
||||||
}
|
}
|
||||||
|
@ -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 parser_context = context.with_additional_node(ContextElement::Context("comment"));
|
||||||
let comment_line_matcher = parser_with_context!(comment_line)(&parser_context);
|
let comment_line_matcher = parser_with_context!(comment_line)(&parser_context);
|
||||||
let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context);
|
let exit_matcher = parser_with_context!(exit_matcher_parser)(&parser_context);
|
||||||
let (remaining, first_line) = comment_line_matcher(input)?;
|
let (remaining, _first_line) = comment_line_matcher(input)?;
|
||||||
let (remaining, remaining_lines) =
|
let (remaining, _remaining_lines) =
|
||||||
many0(preceded(not(exit_matcher), comment_line_matcher))(remaining)?;
|
many0(preceded(not(exit_matcher), comment_line_matcher))(remaining)?;
|
||||||
|
|
||||||
let (remaining, _trailing_ws) =
|
let (remaining, _trailing_ws) =
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use crate::error::CustomError;
|
|
||||||
use crate::error::MyError;
|
|
||||||
use crate::error::Res;
|
use crate::error::Res;
|
||||||
use crate::parser::comment::comment;
|
use crate::parser::comment::comment;
|
||||||
use crate::parser::element_parser::element;
|
use crate::parser::element_parser::element;
|
||||||
|
@ -12,8 +12,6 @@ use super::lesser_block::verse_block;
|
|||||||
use super::paragraph::paragraph;
|
use super::paragraph::paragraph;
|
||||||
use super::plain_list::plain_list;
|
use super::plain_list::plain_list;
|
||||||
use super::Context;
|
use super::Context;
|
||||||
use crate::error::CustomError;
|
|
||||||
use crate::error::MyError;
|
|
||||||
use crate::error::Res;
|
use crate::error::Res;
|
||||||
use crate::parser::parser_with_context::parser_with_context;
|
use crate::parser::parser_with_context::parser_with_context;
|
||||||
use crate::parser::table::org_mode_table;
|
use crate::parser::table::org_mode_table;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use crate::error::CustomError;
|
|
||||||
use crate::error::MyError;
|
|
||||||
use crate::error::Res;
|
use crate::error::Res;
|
||||||
use nom::branch::alt;
|
use nom::branch::alt;
|
||||||
use nom::bytes::complete::is_not;
|
use nom::bytes::complete::is_not;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use crate::error::CustomError;
|
|
||||||
use crate::error::MyError;
|
|
||||||
use crate::error::Res;
|
use crate::error::Res;
|
||||||
use nom::combinator::map;
|
use nom::combinator::map;
|
||||||
use nom::combinator::not;
|
use nom::combinator::not;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use crate::error::CustomError;
|
|
||||||
use crate::error::MyError;
|
|
||||||
use crate::error::Res;
|
use crate::error::Res;
|
||||||
use nom::branch::alt;
|
use nom::branch::alt;
|
||||||
use nom::combinator::eof;
|
use nom::combinator::eof;
|
||||||
|
@ -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(
|
return Err(nom::Err::Error(CustomError::MyError(MyError(
|
||||||
"Should be unreachable.",
|
"Should be unreachable.",
|
||||||
))));
|
))));
|
||||||
unreachable!();
|
// unreachable!();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ pub fn property_drawer<'r, 's>(
|
|||||||
}
|
}
|
||||||
let (
|
let (
|
||||||
remaining,
|
remaining,
|
||||||
(_start_of_line, _leading_whitespace, open_tag, _trailing_whitespace, _line_ending),
|
(_start_of_line, _leading_whitespace, _open_tag, _trailing_whitespace, _line_ending),
|
||||||
) = tuple((
|
) = tuple((
|
||||||
parser_with_context!(start_of_line)(context),
|
parser_with_context!(start_of_line)(context),
|
||||||
space0,
|
space0,
|
||||||
@ -87,7 +87,7 @@ fn node_property<'r, 's>(
|
|||||||
context: Context<'r, 's>,
|
context: Context<'r, 's>,
|
||||||
input: &'s str,
|
input: &'s str,
|
||||||
) -> Res<&'s str, NodeProperty<'s>> {
|
) -> 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((
|
tuple((
|
||||||
parser_with_context!(start_of_line)(context),
|
parser_with_context!(start_of_line)(context),
|
||||||
space0,
|
space0,
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use crate::error::CustomError;
|
|
||||||
use crate::error::MyError;
|
|
||||||
use crate::error::Res;
|
use crate::error::Res;
|
||||||
use nom::branch::alt;
|
use nom::branch::alt;
|
||||||
use nom::bytes::complete::is_not;
|
use nom::bytes::complete::is_not;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user