Apply more suggestions.
This commit is contained in:
@@ -227,7 +227,7 @@ impl<'b, 's> DiffResult<'b, 's> {
|
||||
status_text = status_text,
|
||||
name = self.name,
|
||||
char_offset = preceding_text.chars().count() + 1,
|
||||
message = self.message.as_ref().map(|m| m.as_str()).unwrap_or("")
|
||||
message = self.message.as_deref().unwrap_or("")
|
||||
);
|
||||
for child in self.children.iter() {
|
||||
child.print_indented(indentation + 1, original_document)?;
|
||||
@@ -330,8 +330,8 @@ pub(crate) fn artificial_diff_scope<'b, 's>(
|
||||
.into())
|
||||
}
|
||||
|
||||
pub(crate) fn artificial_owned_diff_scope<'b, 's, 'x>(
|
||||
name: &'x str,
|
||||
pub(crate) fn artificial_owned_diff_scope<'b, 's>(
|
||||
name: &str,
|
||||
children: Vec<DiffEntry<'b, 's>>,
|
||||
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
|
||||
Ok(DiffLayer {
|
||||
@@ -427,12 +427,9 @@ pub(crate) fn compare_ast_node<'b, 's>(
|
||||
// PlainText is a special case because upstream Org-Mode uses relative values for the bounds in plaintext rather than absolute so the below checks do not account for that.
|
||||
if let AstNode::PlainText(_) = rust {
|
||||
} else {
|
||||
match compare_standard_properties(source, emacs, &rust) {
|
||||
Err(err) => {
|
||||
compare_result.status = DiffStatus::Bad;
|
||||
compare_result.message = Some(err.to_string())
|
||||
}
|
||||
Ok(_) => {}
|
||||
if let Err(err) = compare_standard_properties(source, emacs, &rust) {
|
||||
compare_result.status = DiffStatus::Bad;
|
||||
compare_result.message = Some(err.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,7 +492,7 @@ fn _compare_document<'b, 's>(
|
||||
.map(EmacsField::Required),
|
||||
(
|
||||
EmacsField::Required(":path"),
|
||||
|r| r.path.as_ref().map(|p| p.to_str()).flatten(),
|
||||
|r| r.path.as_ref().and_then(|p| p.to_str()),
|
||||
compare_property_quoted_string
|
||||
),
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user