My point is that there is a difference in what it meand to return Result<Q, K> or Result<K, Q> .
But I can’t know what you think the meaning should be, so it doesn’t matter which one I return. This is key, because it means there isn’t any meaningful difference. You will have to interpret it how you want to either way.
In other words, these two functions will both communicate the same thing:
fn ensure_match(&str, &str) -> Result<&str, i32>;
fn ensure_no_match(&str, &str) -> Result<i32, &str>;
It doesn’t matter which one you have. In either case, you will be determining your own semantics for Result rather than using mine.
(Within those functions, maybe it does matter. But that’s an implementation detail.)