pacak / bpaf

Command line parser with applicative interface
337 stars 17 forks source link

`bpaf_derive`: use `heck` for string case conversion? #329

Closed bzm3r closed 7 months ago

bzm3r commented 7 months ago

Currently, bpaf_derive has various utility functions in bpaf_derive/src/utils.rs to handle conversion of strings into snake case, kebab case, and so on.

The heavily used crate heck (from withoutboats) is purpose-built to provide this functionality. Instead of re-implementing and maintaining this in bpaf_derive, should we just use heck?

(I am happy to implement this migration, if it is deemed useful.)

pacak commented 7 months ago

I choose to implement snake/kebab case conversion as well as bpaf::meta_youmean::damerau_levenshtein to keep the compilation time down / supply chain attack surface low. Performance doesn't really matter here, same with behavior outside of ASCII characters. Code just works after initial implementation and is not causing problems. I think I prefer to keep current version unless there's some new problems that can't be solved easily.

bzm3r commented 7 months ago

I choose to implement snake/kebab case conversion as well as bpaf::meta_youmean::damerau_levenshtein to keep the compilation time down / supply chain attack surface low. Performance doesn't really matter here, same with behavior outside of ASCII characters. Code just works after initial implementation and is not causing problems. I think I prefer to keep current version unless there's some new problems that can't be solved easily.

Yup, that makes sense to me. I figured that was your reasoning. :+1: