These are chat archives for rust-lang/rust

13th
Jul 2018
James McCoy
@jamessan
Jul 13 2018 01:31
What about for i in 0 as Rep..5 { ... }
Kelly Thomas Kline
@kellytk
Jul 13 2018 03:00
Why does impl fmt::Debug for Rootcomp not satisfy "yew::app::App<rootcomp::Rootcomp> and how should I be doing it?
Andreas Franzén
@triptec
Jul 13 2018 06:20
hello, heard something about futures being merged to nightly std, is there any link to merge commit or issue?
Andrey Lesnikov
@ozkriff
Jul 13 2018 08:13
@triptec rust-lang/rust#50547 i think this thread should have all the links about async/await
there multiple PRs about async/await and futures. i'm not sure, but you may be interested in this one rust-lang/rust#51580
@kellytk can you show the whole error message?
Andreas Franzén
@triptec
Jul 13 2018 08:26
@ozkriff thanks
trsh
@trsh
Jul 13 2018 09:21
Hi! How do I remove frst el from mut Vec?
Zakarum
@omni-viral
Jul 13 2018 10:16
remove(0) will preserve order but it is O(n)
swap_remove(0) is O(1) but doesn't preserve order
Dmitriy
@dpogretskiy
Jul 13 2018 10:17
or use VecDeque instead
Zakarum
@omni-viral
Jul 13 2018 10:17
Then there is pop_front which is O(1)
Dmitriy
@dpogretskiy
Jul 13 2018 10:17
it's should be more fitting for queing purposes :)
there is even pop_front() for it
jazzbuck
@jazzbuck
Jul 13 2018 12:51
does anyone know whether utah is still being worked on?
trsh
@trsh
Jul 13 2018 13:38
@ozkriff & @omni-viral tnx
trsh
@trsh
Jul 13 2018 15:11
Is it possible to create a loop like for x in 0..10 { println!("{}", x); // x: i32 }
Where I dont care about x ?
It just needs to happen 10 times
One way would be for _x in 0..10
Ichoran
@Ichoran
Jul 13 2018 15:25
I'm not quite sure what you are after. You are printing the x there, so you seem to care about it?
Dmitriy
@dpogretskiy
Jul 13 2018 15:25
other way would be for _ in 0..10
Ichoran
@Ichoran
Jul 13 2018 15:26
Yeah, if you just don't want to name the variable, that's the thing to do.
I guess if you really don't want to make it look like a range you could do something like for _ in std::iter::repeat(()).take(5)
But I think your intent is less clear that way.
trsh
@trsh
Jul 13 2018 16:45
Yeah tnx, _ will do