mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
fix debug impl
This commit is contained in:
parent
b42cc3d625
commit
fbf3ba77e9
1 changed files with 15 additions and 6 deletions
|
@ -524,14 +524,23 @@ impl std::fmt::Debug for SetElement<'_> {
|
||||||
|
|
||||||
impl std::fmt::Debug for LambdaSet<'_> {
|
impl std::fmt::Debug for LambdaSet<'_> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
let entries = self.set.iter().map(|x| SetElement {
|
struct Helper<'a> {
|
||||||
symbol: x.0,
|
set: &'a [(Symbol, &'a [Layout<'a>])],
|
||||||
layout: x.1,
|
}
|
||||||
});
|
|
||||||
let set = f.debug_list().entries(entries).finish();
|
impl std::fmt::Debug for Helper<'_> {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
let entries = self.set.iter().map(|x| SetElement {
|
||||||
|
symbol: x.0,
|
||||||
|
layout: x.1,
|
||||||
|
});
|
||||||
|
|
||||||
|
f.debug_list().entries(entries).finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
f.debug_struct("LambdaSet")
|
f.debug_struct("LambdaSet")
|
||||||
.field("set", &set)
|
.field("set", &Helper { set: self.set })
|
||||||
.field("representation", &self.representation)
|
.field("representation", &self.representation)
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue