-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ids to second occurrence of a type within a dump #60
Add ids to second occurrence of a type within a dump #60
Conversation
This is definitely an improvement! Brandon and I will look at this and maybe bikeshed some formatting details on Monday. |
Sources/CustomDump/Dump.swift
Outdated
let id = idPerItem[item, default: occurence] | ||
idPerItem[item] = id | ||
|
||
return id > 1 ? "<\(id)>" : "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thought (suggested by Brandon) is to maybe use #
instead of <>
to avoid clashing with generic parameter list syntax:
return id > 1 ? "<\(id)>" : "" | |
return id > 1 ? "#\(id)" : "" |
Thoughts? Any concerns with such a change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just one change we'd like to consider.
ad7129e
to
457714a
Compare
457714a
to
fb714f5
Compare
Adding a unique id for occurrences of the same type.
Motivation