diff --git a/src/rust/protover/protover.rs b/src/rust/protover/protover.rs index 60bdc9d833..5e281a3e92 100644 --- a/src/rust/protover/protover.rs +++ b/src/rust/protover/protover.rs @@ -99,13 +99,17 @@ pub fn get_supported_protocols() -> String { } /// Translates a vector representation of a protocol list into a HashMap -fn parse_protocols<'a, P: Iterator>( +fn parse_protocols( protocols: P, -) -> Result>, &'static str> { +) -> Result>, &'static str> +where + P: Iterator, + S: AsRef, +{ let mut parsed = HashMap::new(); for subproto in protocols { - let (name, version) = get_proto_and_vers(subproto)?; + let (name, version) = get_proto_and_vers(subproto.as_ref())?; parsed.insert(name, version); } Ok(parsed) @@ -130,7 +134,7 @@ fn parse_protocols_from_string<'a>( /// of the error. /// fn tor_supported() -> Result>, &'static str> { - parse_protocols(SUPPORTED_PROTOCOLS.iter().map(|n| *n)) + parse_protocols(SUPPORTED_PROTOCOLS.iter()) } /// Get the unique version numbers supported by a subprotocol.