argument_handling: fix compilation
/// "bar=", // Can be "--bar=value" and "--bar value"
/// ];
/// ```
-pub fn remove_arguments<T: AsRef<str>>(arguments_to_remove: &[T], arguments: &mut Vec<String>) {
+pub fn remove_arguments<T>(arguments_to_remove: &[T], arguments: &mut Vec<String>)
+where
+ T: AsRef<str> + std::fmt::Display,
+{
// We iterate all arguments that possibly have to be removed
// and remove them if they occur to be in the input.
for argument in arguments_to_remove.iter() {
@@ -17,7 +20,8 @@ pub fn remove_arguments<T: AsRef<str>>(arguments_to_remove: &[T], arguments: &mu
// If the original arg contained an equal sign we take this as a hint
// that the arg can be used as `--arg value` as well as `--arg=value`.
// In the prior case we need to remove two arguments. So remember this.
- let (remove_two, clean_argument) = if let Some(stripped) = argument.strip_suffix('=') {
+ let (remove_two, clean_argument) =
+ if let Some(stripped) = argument.to_string().strip_suffix('=') {
(true, format!("--{}", stripped))
} else {
(false, format!("--{}", argument))
