Open alex opened 4 years ago
There were some tactics explored in the comments for #1190. There might be something there for you, but I agree. The trait bounds are tricky to reverse engineer for this.
Waaa, a wild Owen appears! 👋
I ultimately went with a configure()
solution, which seems to work well enough, even if it makes the caller slightly more verbose than I'd like.
It seems like the best short-term solution would be to highlight configure()
more in the docs -- particularly I think it'd be good if the testing docs used it.
It could be great to have such a possibility. I don't think that workarounds are a proper solution for this.
Some progress made in #1692. As a breaking change, it won't be around until v4 though.
I'm trying to write a function that builds my app, that way it can be reused between my
main
function and my tests. Unfortunate, the type parameters foractix_web::App
or theIntoServiceFactory
traits are incredibly verbose. Ideally doing something like this would be straightforward:I think the right solution might be a type alias that would let you do
-> impl Something
, but I'm open to suggestions on what the right way to handle this ergonomic issue are.