What you wrote currently says that it accepts a closure which takes some specific type T, for which you know that T implements AsRef<str>. However what you want is that it should accept any type T that implements AsRef<str>. These are not the same things.
Unfortunately this kind of for-all bound is only possible with lifetimes, not types.
Currently the only way to get something like generic closures / function types is to create your own Fn-trait alternatives and implement those manually.