Commit 6e8614d
committed
Add more methods matching the standard HashMap
- `pub fn get_key_value<Q: ?Sized>(&self, key: &Q) -> Option<(&K, &V)>`
- Stabilized in Rust 1.40.
- This is a middle-ground between `get` and our own `get_full` that
includes the index. It's easy enough to add for compatibility.
- `pub fn remove_entry<Q: ?Sized>(&mut self, key: &Q) -> Option<(K, V)>`
- Stabilized in Rust 1.27.
- For `IndexMap`, this also adds `swap_`/`shift_remove_entry` choices.
- These are also a middle-ground between (`swap_`/`shift_`)`remove` and
our own `swap`/`shift_remove_full` that include the index. We don't
have a plain `remove_full` though.1 parent 299d950 commit 6e8614d
2 files changed
+71
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
345 | 361 | | |
346 | 362 | | |
347 | 363 | | |
| |||
424 | 440 | | |
425 | 441 | | |
426 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
427 | 457 | | |
428 | 458 | | |
429 | 459 | | |
| |||
441 | 471 | | |
442 | 472 | | |
443 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
444 | 493 | | |
445 | 494 | | |
446 | 495 | | |
| |||
480 | 529 | | |
481 | 530 | | |
482 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
483 | 551 | | |
484 | 552 | | |
485 | 553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
| 442 | + | |
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
| 459 | + | |
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| |||
0 commit comments