But a question, why does that work? The return is Either<impl Display, impl Display> which shouldn't work with the impl Deref for Either as it's impl Display and not &impl Display and there isn't an impl like this:
The return value of my_func is generally Either<impl Display, impl Display>, and in this particular case, Either<i32, usize> since both types satisfy the impl Display requirement. All Either's deref target requires is that the type implements the Display trait. I'm not sure where you're getting &impl Display from.
Well it's because I presumed that because neither usize nor i32 implement deref, that it wouldn't satisfy the Deref impl on Either
I mentioned the &impl Display because that would satisfy the constraints, &T: Deref<Target=T>