mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
improve Constraint Debug impl
This commit is contained in:
parent
8b92401d01
commit
401b3fd5ad
1 changed files with 14 additions and 20 deletions
|
@ -550,6 +550,7 @@ pub struct IncludesTag {
|
||||||
pub region: Region,
|
pub region: Region,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Custom impl to limit vertical space used by the debug output
|
||||||
impl std::fmt::Debug for Constraint {
|
impl std::fmt::Debug for Constraint {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
|
@ -559,32 +560,25 @@ impl std::fmt::Debug for Constraint {
|
||||||
Self::Store(arg0, arg1, arg2, arg3) => {
|
Self::Store(arg0, arg1, arg2, arg3) => {
|
||||||
write!(f, "Store({:?}, {:?}, {:?}, {:?})", arg0, arg1, arg2, arg3)
|
write!(f, "Store({:?}, {:?}, {:?}, {:?})", arg0, arg1, arg2, arg3)
|
||||||
}
|
}
|
||||||
Self::Lookup(arg0, arg1, arg2) => f
|
Self::Lookup(arg0, arg1, arg2) => {
|
||||||
.debug_tuple("Lookup")
|
write!(f, "Lookup({:?}, {:?}, {:?})", arg0, arg1, arg2)
|
||||||
.field(arg0)
|
}
|
||||||
.field(arg1)
|
Self::Pattern(arg0, arg1, arg2, arg3) => {
|
||||||
.field(arg2)
|
write!(f, "Pattern({:?}, {:?}, {:?}, {:?})", arg0, arg1, arg2, arg3)
|
||||||
.finish(),
|
}
|
||||||
Self::Pattern(arg0, arg1, arg2, arg3) => f
|
|
||||||
.debug_tuple("Pattern")
|
|
||||||
.field(arg0)
|
|
||||||
.field(arg1)
|
|
||||||
.field(arg2)
|
|
||||||
.field(arg3)
|
|
||||||
.finish(),
|
|
||||||
Self::True => write!(f, "True"),
|
Self::True => write!(f, "True"),
|
||||||
Self::SaveTheEnvironment => write!(f, "SaveTheEnvironment"),
|
Self::SaveTheEnvironment => write!(f, "SaveTheEnvironment"),
|
||||||
Self::Let(arg0, arg1) => f.debug_tuple("Let").field(arg0).field(arg1).finish(),
|
Self::Let(arg0, arg1) => f.debug_tuple("Let").field(arg0).field(arg1).finish(),
|
||||||
Self::And(arg0) => f.debug_tuple("And").field(arg0).finish(),
|
Self::And(arg0) => f.debug_tuple("And").field(arg0).finish(),
|
||||||
Self::IsOpenType(arg0) => f.debug_tuple("IsOpenType").field(arg0).finish(),
|
Self::IsOpenType(arg0) => f.debug_tuple("IsOpenType").field(arg0).finish(),
|
||||||
Self::IncludesTag(arg0) => f.debug_tuple("IncludesTag").field(arg0).finish(),
|
Self::IncludesTag(arg0) => f.debug_tuple("IncludesTag").field(arg0).finish(),
|
||||||
Self::PatternPresence(arg0, arg1, arg2, arg3) => f
|
Self::PatternPresence(arg0, arg1, arg2, arg3) => {
|
||||||
.debug_tuple("PatternPresence")
|
write!(
|
||||||
.field(arg0)
|
f,
|
||||||
.field(arg1)
|
"PatternPresence({:?}, {:?}, {:?}, {:?})",
|
||||||
.field(arg2)
|
arg0, arg1, arg2, arg3
|
||||||
.field(arg3)
|
)
|
||||||
.finish(),
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue