-
Notifications
You must be signed in to change notification settings - Fork 103
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
Implement std::fmt::Debug
for Map
manually
#305
Conversation
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.
Sadly this means that we'll need to update Debug
every time a member changes in Map
, but it's better than what we had before IMO. Thanks!
Didn't see this was a draft -- Are you planning to add anything else? |
.field("tilesets", &format!("{} tilesets", self.tilesets.len())) | ||
.field("layers", &format!("{} layers", self.layers.len())) |
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.
Instead of debug-printing all tilesets and layers, we only debug-print the length of self.tilesets
and self.layers
.
I don't know if this is a viable approach as it calls len
and allocates String
with format!
, which would be not as performant as desired. On the other hand, we're talking about Debug
here, which should/must be only relied upon debug builds, not release builds (only logs maybe).
I was checking |
It's ok, we'll do it manually - Same thing we have done for |
Well, I'm going to check |
I've checked the rs-tiled/src/layers/tile/finite.rs Lines 19 to 26 in f86e079
rs-tiled/src/layers/tile/infinite.rs Lines 18 to 22 in f86e079
So, I think it's good to go. Feel free to merge. 🍺 |
Great, thank you! |
std::fmt::Debug
for Map
and TileLayer
manuallystd::fmt::Debug
for Map
and TileLayer
manually
std::fmt::Debug
for Map
and TileLayer
manuallystd::fmt::Debug
for Map
manually
Closes #138
Self-explanatory