« first day (1804 days earlier)      last day (1667 days later) » 

12:03 PM
Am I missing something, or currently there is no way to tell the compiler that a for or while loop will never return (i.e. they are ! instead of ())?
 
@PeterVaro use loop
 
so when you have an fn main() -> ! and you used an infinite iterator abstraction, are you writing things like:
loop
{
    let next = iter.next().unwrap();
    /* use next ... */
}
 
A bit old news, but just letting you know that the RustConf 2019 talks are online at the official Rust channel. youtube.com/playlist?list=PL85XCvVPmGQhDOUIZBe6u388GydeACbTt
 
@E_net4theMeta-RemoveR I almost listened to all of them by now -- but thanks nonetheless ;)
@Stargateur ^^^ this is just silly
 
@PeterVaro A living proof that it's good stuff indeed, definitely worth sharing. ;)
 
12:09 PM
@PeterVaro you could use unreachable I guess
 
after the for? I was thinking about that, but for some unknown reason I haven't tried it
gi'mme a mo'
yup, it works
better than the alternative IMO
but it feels and looks clunky anyway
this is not good..
 
have a infinite loop is silly by nature anyway
I never do
also better use while than for in this case
 
umm.. are you not doing any bare metal embedded?
I thought you are..
 
I always have a cond to exist
even just a bool
 
why?
 
12:13 PM
and catch SIGINT
because a program should stop
 
well, that's what a panic handler is for
(we are still talking about embedded, remember?)
 
I don't really care, I just talking about good code :p
 
arguably "good" code..
:D
 
 
2 hours later…
1:56 PM
2
Q: Iterating over &Vec<T> and Vec<&T>

mrsplI have an enum with two variants: Either it contains a reference to a Vec of Strings, or it contains a Vec of references of Strings: enum Foo<'a> { Owned(&'a Vec<String>), Refs(Vec<&'a String>) } Now I want to iterate over references to the Strings in this enum. I tried to implement a...

 
2:50 PM
Nobody was answering or even commenting for 40 minutes so I made an answer... And then, 3 answers come in the same minute ^^
 
3:04 PM
@PeterVaro is right but @Stargateur's approach is more... iunno, logical?
although it also depends on the target as well
in most cases you can break clean out of a loop with certain interrupts even without conditions in the loop
if that is your only reason to break out of it the condition is pointless overhead
 
3:20 PM
@DenysSéguret at least your answer is much better
 
 
2 hours later…
5:43 PM
PRed the shelfie thing I found the other day
turns out you can crash it in 42 different ways
 
 
1 hour later…
6:50 PM
Wow, a confusion with the video game here on SO. Amazing.
 
7:11 PM
@LukasKalbertodt Aand the OP is acting defensive...
 
@E_net4theMeta-RemoveR Yeah, sad :/
 
I know what im looking for, and I would much rather ask here. — Kyle Fournier 32 secs ago
*facepalm* must be new here
If anyone's got an extra close vote, please cast it.
 
@E_net4theMeta-RemoveR Already did. It's closed.
Awesome, glad to know you guys are helping. Thanks for Jack shit guys :) — Kyle Fournier 1 min ago
Sad :/ I thought I could maybe turn it around. But some people...
 
Meh, it's hard to sympathize here. These evident cases of entitlement are a negative contribution.
 
They apologized! :)
 
7:22 PM
And the code of conduct applies. To everyone.
 
@E_net4theMeta-RemoveR True
 
8:11 PM
I saw this crate on Reddit just a few days ago
 

« first day (1804 days earlier)      last day (1667 days later) »