etolbakov / excalidocker-rs

Convert your docker-compose into excalidraw
MIT License
123 stars 6 forks source link

improve the existing solution with multiple `HashMap` structs #14

Open etolbakov opened 1 year ago

etolbakov commented 1 year ago

It feels that these number of structs is excessive: https://github.com/etolbakov/excalidocker-rs/blob/99459d082a0b413cd0994094f4fcf80f4320ab2d/src/main.rs#L143-L147 During the development I came up with the most straightforward solution and didn't have much time to reflect on the optimal one, but maybe we can reduce the number of HashMap structs.

etolbakov commented 1 year ago

As per suggestion I received

To address this issue, I suggest refactoring the code to use a single HashMap with a custom struct to store the different types of data associated with container names. This approach would help simplify the codebase and reduce redundancy.