Skip to content

Commit

Permalink
refactor: Fix clippy issues (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroh authored May 24, 2024
1 parent cd9adcc commit 06e78d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
13 changes: 8 additions & 5 deletions bin/src/control.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::{error::Error, fmt};
use std::{
error::Error,
fmt::{self, Display},
};

use matching::matching_configuration;
use parsing::ParserConfiguration;
Expand Down Expand Up @@ -30,11 +33,11 @@ pub enum ExecutionResult {
WithoutConflicts(String),
}

impl ToString for ExecutionResult {
fn to_string(&self) -> String {
impl Display for ExecutionResult {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
ExecutionResult::WithConflicts(value) => value.to_owned(),
ExecutionResult::WithoutConflicts(value) => value.to_owned(),
ExecutionResult::WithConflicts(value) => write!(f, "{}", value),
ExecutionResult::WithoutConflicts(value) => write!(f, "{}", value),
}
}
}
Expand Down
9 changes: 3 additions & 6 deletions merge/src/merged_cst_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,9 @@ impl Display for MergedCSTNode<'_> {
write!(f, "{}", result)
}
MergedCSTNode::Conflict { left, right } => match (left, right) {
(Some(left), Some(right)) => write!(
f,
"<<<<<<<<< {} ========= {} >>>>>>>>>",
left,
right
),
(Some(left), Some(right)) => {
write!(f, "<<<<<<<<< {} ========= {} >>>>>>>>>", left, right)
}
(Some(left), None) => {
write!(f, "<<<<<<<<< {} ========= >>>>>>>>>", left)
}
Expand Down

0 comments on commit 06e78d3

Please sign in to comment.