Skip to content
Snippets Groups Projects
Verified Commit b87ad1e1 authored by Vincent Lafeychine's avatar Vincent Lafeychine
Browse files

clippy: Fix impl_trait_in_params

parent 23799784
No related branches found
No related tags found
1 merge request!47Fix most of `clippy::restriction` and `clippy::pedantic`
......@@ -32,7 +32,6 @@ rustflags = [
"-Aclippy::string_lit_as_bytes",
# clippy::restriction
"-Aclippy::impl_trait_in_params",
"-Aclippy::mod_module_files",
"-Aclippy::non_ascii_literal",
"-Aclippy::panic_in_result_fn",
......
......@@ -10,10 +10,10 @@ use std::ops::Deref;
/// If a command-line option matches `find_arg`, then apply the predicate `pred` on its value. If
/// true, then return it. The parameter is assumed to be either `--arg=value` or `--arg value`.
pub fn arg_value<'a, T: Deref<Target = str>>(
pub fn arg_value<'a, T: Deref<Target = str>, F: Fn(&str) -> bool>(
args: &'a [T],
find_arg: &str,
pred: impl Fn(&str) -> bool,
pred: F,
) -> Option<&'a str> {
let mut args = args.iter().map(Deref::deref);
while let Some(arg) = args.next() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment