The below definition, in my opinion has unnecessary param Q, as the trait bound provided is identical to param P. Am I correct or yet again, I don't understand?
pub fn copy_items<P, Q>(from: &[P], to: Q, options: &dir::CopyOptions)
where
P: AsRef<Path>,
Q: AsRef<Path>,
{
}
No. The current signature of the function says that both P and Q implements AsRef<Path>. And they can be different types because the definition allows it. But using P instead of Q would mean that both from and to parameters have the same type. P only describes one type, but P and Q describes two potentially different types.