mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +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<'_> {
|
||||
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,
|
||||
});
|
||||
let set = f.debug_list().entries(entries).finish();
|
||||
struct Helper<'a> {
|
||||
set: &'a [(Symbol, &'a [Layout<'a>])],
|
||||
}
|
||||
|
||||
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")
|
||||
.field("set", &set)
|
||||
.field("set", &Helper { set: self.set })
|
||||
.field("representation", &self.representation)
|
||||
.finish()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue