These are chat archives for rust-lang/rust

29th
Oct 2018
Sean Perry
@shaleh
Oct 29 2018 02:23
Say I have two iterators from things that do not have a length operation. I want to use it1.zip(it2) in a loop comparing the items returned and returning when they are not equal. But if I run out of items early from one iterator that is also a reason to return false. How do I detect that one finished early?
rsb007
@rsb007
Oct 29 2018 05:58
how to get particular data field from query string ?
Sean Perry
@shaleh
Oct 29 2018 06:31
@Vitaly yeah, that is my fall back. I was hoping to keep it "pretty".
Ichoran
@Ichoran
Oct 29 2018 06:55
There isn't a built-in that does it. I'd probably use all to get half of the work done, though:
    iter1.all(|i1| match iter2.next() { 
          Some(i2) => i1 == i2,
          _ => false
    }) && iter2.next().is_none()
Dmitriy
@dpogretskiy
Oct 29 2018 07:03
ain't zip a thing?
well, i guess it's not counting length in
Ichoran
@Ichoran
Oct 29 2018 07:04
Zip doesn't tell you about the length.
rsb007
@rsb007
Oct 29 2018 07:04
@Ichoran how to get particular data field from query string ?
Ichoran
@Ichoran
Oct 29 2018 07:06
@rsb007 - You mean with actix-web? Sorry, I can't answer that off the top of my head, though I think I did do it once. Generally with actix the best way to answer questions is to look through the examples to see if anything does what you want.
rsb007
@rsb007
Oct 29 2018 07:06
@Ichoran ok thanks
Sean Perry
@shaleh
Oct 29 2018 07:55
@Ichoran nice! Solid example. Thank you.
Vitaly
@Virtuos86
Oct 29 2018 08:05

There isn't a built-in that does it. I'd probably use all to get half of the work done, though:

    iter1.all(|i1| match iter2.next() { 
          Some(i2) => i1 == i2,
          _ => false
    }) && iter2.next().is_none()

Nice unsound trick.

Sean Perry
@shaleh
Oct 29 2018 08:25
in my case, I do not think Peekable helps Vitaly.
Vitaly
@Virtuos86
Oct 29 2018 08:29
Sorry, I've posted this not for your case.)
Rotem Yaari
@vmalloc
Oct 29 2018 08:33
Hi, anyone knows how I can prevent cargo clippy from failing on dependent packages? It keeps complaining about cached dependencies under $HOME/.cargo/registry...
Rotem Yaari
@vmalloc
Oct 29 2018 08:43
sorry - my bad, forgot to run with nightly
Ichoran
@Ichoran
Oct 29 2018 15:35
@Virtuos86 - How is that unsound? It uses mutability, but soundly.
Vitaly
@Virtuos86
Oct 29 2018 18:02
@Ichoran I call "unsound" using of all to solve this problem.
Ichoran
@Ichoran
Oct 29 2018 18:20
Why? "Unsound" means that it could break unless you use it cautiously. That's not the case here.
Zakarum
@omni-viral
Oct 29 2018 18:20
I don't get it. 1.30 announcement has a snippet with proc macro which result is expression. But rustc gives me error (when I try to use such macro) about proc-macro yielding expressions are not supported
Victor Lopes
@vlopes11
Oct 29 2018 21:47
Colleagues, someone have successful experiences with arch linux cross compiler? https://wiki.archlinux.org/index.php/Rust#Windows
Tom Watson
@FridgeSeal
Oct 29 2018 22:22
I haven’t compiled to archlinux
Oh I didn’t mean to send that yet lol
But I was going to say Rust Cross might be of use to you: