Commit 5b5966d
refactor: replace unwrap with idiomatic get_or_insert_with in add_submodule
This change refactors `SubmoduleEntries::add_submodule` to use
`get_or_insert_with(HashMap::new)` instead of a manual `is_some()` check
followed by `unwrap()`. This improves code readability and follows Rust
idioms for handling `Option` types.
Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>1 parent a50023b commit 5b5966d
1 file changed
Lines changed: 4 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
758 | 746 | | |
759 | 747 | | |
760 | 748 | | |
| |||
0 commit comments