mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 18:27:38 +00:00
files: implement Debug for MergeResult, display byte vector as string
This commit is contained in:
parent
856b219943
commit
f6839a4ceb
1 changed files with 13 additions and 1 deletions
|
@ -192,12 +192,24 @@ impl Debug for MergeHunk {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
#[derive(PartialEq, Eq, Clone)]
|
||||
pub enum MergeResult {
|
||||
Resolved(Vec<u8>),
|
||||
Conflict(Vec<MergeHunk>),
|
||||
}
|
||||
|
||||
impl Debug for MergeResult {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> {
|
||||
match self {
|
||||
MergeResult::Resolved(data) => f
|
||||
.debug_tuple("Resolved")
|
||||
.field(&String::from_utf8_lossy(data))
|
||||
.finish(),
|
||||
MergeResult::Conflict(hunks) => f.debug_tuple("Conflict").field(hunks).finish(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A region where the base and two sides match.
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
struct SyncRegion {
|
||||
|
|
Loading…
Reference in a new issue