Im pretty sure I’ve seen Aleksey use generic code written by @tomaka17 as a stress test for @rust_analyzer. I think I remember seeing something with like 25 `where` clauses.
-
-
-
Replying to @yaahc_ @ManishEarth and
Im really trying to find that code. It was a marvel.
1 reply 0 retweets 6 likes -
Replying to @bitshiftmask @yaahc_ and6 replies 2 retweets 29 likes
-
-
Replying to @iximeow @bitshiftmask and
As much as I admire you for being able to produce this that does compile, no sane human can consume this API.
2 replies 0 retweets 1 like -
Sometimes complex impls are in service of minimal APIspic.twitter.com/Q1jBHtfbBv
3 replies 0 retweets 11 likes -
Yeah, having APIs like this with lots of *independent* generic parameters is NBD imo pretty easy to use, most folks define a type alias if they need to name the type a lot but only use one impl
1 reply 0 retweets 8 likes -
Replying to @ManishEarth @yaahc_ and
I have some really terrible examples from early Stylo days that I should scrounge up, where the type parameters are all entangled
1 reply 0 retweets 3 likes -
Replying to @ManishEarth @yaahc_ and
I had some examples from Diesel that I used to think were horrible until I saw some open source code that... Was extremely generic.
2 replies 0 retweets 6 likes
This file has been cleaned up since I last looked, but here's a type for you. https://github.com/libp2p/rust-libp2p/blob/d55871623ca64cbe5746e339fd6c19a7c1ba94d1/swarm/src/lib.rs#L108-L116 … And some bounds https://github.com/libp2p/rust-libp2p/blob/d55871623ca64cbe5746e339fd6c19a7c1ba94d1/swarm/src/lib.rs#L201-L226 …
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
