Commit 7e45c45
authored
fix(bevy_ptr): correct Debug impl for MovingPtr (#21040)
# Objective
1. Fix incorrect macro usage in Debug implementation.
2. (unimportant) Enforce consistent formatting for unsafe blocks.
## Solution
1. I'm not sure why `$ptr` appeared in the `Debug` implementation for
`MovingPtr`, as this isn't in a macro context. I believe it was a
mistake, so I changed `stringify!($ptr)` to `"MovingPtr"`.
2. If a function has no return value (returns `()`), the final statement
should end with a semicolon. (At least maintain a consistent style.)
Therefore, change `unsafe { ... };` and `unsafe { ... }` to the unified
`unsafe { ...; }`.
## Testing
- `cargo test -p bevy_ptr` is passed.
- Several examples have been running normally.
- No more testing is needed.1 parent 25fd63b commit 7e45c45
1 file changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
| |||
734 | 738 | | |
735 | 739 | | |
736 | 740 | | |
737 | | - | |
| 741 | + | |
738 | 742 | | |
739 | 743 | | |
740 | 744 | | |
741 | 745 | | |
742 | 746 | | |
743 | 747 | | |
744 | | - | |
| 748 | + | |
745 | 749 | | |
746 | 750 | | |
747 | 751 | | |
| |||
0 commit comments