I have a function defined as follows:
pub fn run<I, S>(command: S, args: I) -> Result<Output>
where
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
{
And I am trying to call it as such:
run(prog, [OsStr::new("a"), OsStr::new("b")]);
And the compiler is complaining that:
| |_____________^ expected `&str`, found `&OsStr`
|
= note: expected reference `&str`
found reference `&std::ffi::OsStr`
Why is it deducing &str ?