Commit 9f6eb29
committed
rollup merge of rust-lang#20214: bluss/fix-hashmap-example
The example derived Hash + Eq on a type that was used as *values* for
a hashmap.. for the example to make sense, we have to use a custom *key*
type.
Write a slightly more involved example, still using Vikings, but this
time as key.
I preferred using String over &str here, since that's the typical usage
and we might want to lead users down that path.1 file changed
+18
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
275 | | - | |
276 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
279 | 287 | | |
280 | 288 | | |
281 | | - | |
282 | | - | |
283 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
284 | 292 | | |
285 | | - | |
286 | | - | |
287 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
| |||
0 commit comments