Azure / GuestProxyAgent

MIT License
3 stars 10 forks source link

Use strong enum type instead of string. #131

Closed ZhidongPeng closed 1 month ago

ZhidongPeng commented 1 month ago

Searched our codebase with "&'static str" and replace them with strong type enum.

This PR is addressing the feedback from https://github.com/Azure/GuestProxyAgent/issues/117 There are a couple of places where the use of new enums would be more robust, e.g. ModuleState has associated string constants, which doesn't prevent other arbitrary states from being used where a module state is expected, leading to the rather awkward and very fragile need to use a comment! pub status: String, // ModuleState, RUNNING|STOPPED