Commit 2d77f23
authored
Rollup merge of rust-lang#148540 - tromey:non-zero-gdb-cleanup, r=bjorn3
Minor fixes to StdNonZeroNumberProvider for gdb
While looking at the pretty-printers, I found a few minor oddities in StdNonZeroNumberProvider.
First, gdb.Type.fields() already returns a sequence, so there's no need to call list().
Second, it's more idiomatic for the (somewhat misnamed) to_string method to simply return the underlying gdb.Value. This also lets gdb apply whatever formats were passed to `print`, as the new test shows.
Third, there's no need to use the field's name when looking up a field in a value, the gdb.Field itself can be used.2 files changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
| |||
0 commit comments