Skip to content

Conversation

@ivarflakstad
Copy link
Collaborator

There is some merit to using &'static str, but it doesn't actually prevent bad usage as you could do something like Box::leak(String::new("my-string").into_boxed_str()).
Incidentally if you need to add an extra arg that is not static then the Box::leak approach is also the solution to get around this restriction. So imo good ol' String is a better choice.

@ivarflakstad ivarflakstad changed the title Capture extra args as strings Capture extra args as Vec<String> Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant