These are chat archives for rust-lang/rust

9th
Nov 2017
Zakarum
@omni-viral
Nov 09 2017 10:33
Why closures aren't clonnable?
Even if it captures nothing
Jonas Platte
@jplatte
Nov 09 2017 10:35
@omni-viral rust-lang/rust#44490
Seems like nightly supports it with clone_closures (and copy_closures for Copy impls)
Zakarum
@omni-viral
Nov 09 2017 10:37
Indeed
Nightly compiler doesn't mention it. But it does for other features
Thanks!
I was trying to prepend closure with & as &[closure] should be always clonable.
But if &2 has 'static lifetime. &|i: i32| println!("{}", i) has short lifetime
Judson Lester
@nyarly
Nov 09 2017 17:13
I'm considering implementing a wrapper struct for uris in order to handle hyper::uri::Uri vs uri::Uri (i.e. I'd like to use uri::Uri mostly, but then I'll need hyper ones to actually do work) - I imagine implementing From and Into on my wrapper struct (probably via String in at least one leg).
Is that sensible, or am I about to buy a bunch of frustration?
Hans W. Uhlig
@huhlig
Nov 09 2017 17:14
why not improve uri::Uri and patch hyper::uri::Uri to use the improved version
it would be nice to defragment that
Judson Lester
@nyarly
Nov 09 2017 17:14
Why doesn't hyper use uri?
Hans W. Uhlig
@huhlig
Nov 09 2017 17:15
This message was deleted
nih rather
Judson Lester
@nyarly
Nov 09 2017 17:15
Fair question - partly because I want to just Get This Done, and because if it works it'll feel like a validation of what I understand of Rust.
And issuing a PR against a project that NIH'd a URI implementation seems quixotic?
Also, I just got smacked down for suggesting that an Oauth2 library not depend on reqwest...
Hans W. Uhlig
@huhlig
Nov 09 2017 17:33
I honestly don't know
OAuth2 is kind of a tricky thing. Can you abstract away the neccessary mechnics without binding it to the http layer?
since it's a lot of back and forth and header/request manipulation
or do you basically write a new library for each http implementation?
even if you package them all together
Moggers
@Moggers
Nov 09 2017 23:29
Whats the current best in class redis client implementation?
is it redis_async?