serenity-rs / poise

Discord bot command framework for serenity, with advanced features like edit tracking and flexible argument parsing
MIT License
597 stars 106 forks source link

Take prefix as Cow<'static, str> #242

Closed GnomedDev closed 5 months ago

GnomedDev commented 5 months ago
kangalio commented 5 months ago

This is admittedly a tiny amount of churn, but for an even more minuscule amount of resource saving...

GnomedDev commented 5 months ago

Small incremental changes are how we improve. This has bugged me for absolutely ages though

kangalio commented 5 months ago

Alright. I personally feel that the type used for the prefix is so negligible for performance (prefix is static, and dynamic_prefix is only convenience for the purer stripped_dynamic_prefix), that the decision should be purely based on usability. And Rust's default go-to string type for everything that's not specialized is just String, hence to me String does feel cleaner than Cow<'static, str> here. But I don't really feel like bickering about this because I suppose in the end it's a small change