`Debug` impl for `Vec2` discards important information
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
Describe the bug
Formatting a Vec2 with {:?} leads to its Debug impl to format both coordinates with {:.1}, which discards any decimal digits after the first.
To Reproduce
Steps to reproduce the behavior:
format!("{:?}", vec2(0.01, -0.01))"[0.0 -0.0]"
(untested)
Expected behavior
Formatting a value should not discard important information. Debug especially shouldn't be doing that.
Note that the Display impl does not have this problem.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect crates/emath/src/vec2.rs at the referenced lines 485-493, then reproduce the issue with format!("{:?}", vec2(0.01, -0.01)). Done means the Debug output no longer discards important decimal digits, while the existing Display behavior remains unaffected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100