DEV Community

loading...

Discussion on: Rust and Go department directories

Collapse
pickfire profile image
Ivan Tham • Edited

Besides the return and weird naming (should be snake_case rather than camelCase and PascalCase like go). I would just use match against the slice rather than the first item to prevent the user from specifying extra values and not needing to check len(parts), this can remove those functions and do all the checks inside the match, probably can save 10-30 lines as it would remove the need for Action. You can also just derive Default rather than new function.