« first day (1648 days earlier)      last day (1844 days later) » 

5:33 AM
@DenysSéguret ask them what is the size of void if them answer you 1 they don't understand C ;)
@DenysSéguret wow nice
Damm !
 
6:21 AM
I just checked. 3 days between my suggestion and the thing in production. This is good
 
7:14 AM
It's supposed to be ready but... github.com/TimonPost/crossterm/blob/…
I'll try to explain him how to log...
(yes, when you build a terminal application with crossterm you may now have random prints in the middle of your screen)
 
7:55 AM
haha
 
I'm suggesting him to use the log crate in his lib. Of course that means a dependency. Do you think it's a good idea or not ?
 
I think yes, log is very light, the question is what implementation to use, fern ? docs.rs/fern*/fern/
 
It might not be easy to choose among the various ones. Did somebody extensively compared them ? I use simplelog in my projects but I have no idea whether it's really better than the other ones (for simple projects)
 
8:40 AM
Why no answer for that question ? stackoverflow.com/questions/55758835/…
Jut a comment about AtomicBool and reading the doc is harsh, this isn't a trivial problem
 
I'm not interested.
 
@DenysSéguret you are 36 second ahead of me play.rust-lang.org/…
:D was just going to post it as answer of MCVE
 
@FrenchBoiethios It's hard to make a better minimal example for a thread problem based on stdin
@AkinerAlkan sorry. I did comment here before to see whether somebody was going to answer...
 
I was just joking ^^
 
Seriously, I don't want to answer when somebody's else is already working on an answer. I'm not competing
 
8:53 AM
I am just trying to solve such minimal problems on parallel for my self learning :) So there is completely no problem for me :) Besides, You are 262K rep which I can't even dream to get and compete :)
 
well, if you ask me to not answer when you think you can, you'll improve your rep. And you're probably more competent than me in Rust so it's OK
 
@DenysSéguret Stdin is only in one thread
 
@FrenchBoiethios what I meant is that the playground won't let you demonstrate stdin, it's not trivial to put up a MCVE online for that
 
I mean: the only issue is with the bool shared amongst threads. That makes the question a duplicate, IMO.
 
@FrenchBoiethios I don't yet have a clear view of the already answered questions and there was no close vote...
 
the reference was a kind of typo. I fixed it
@FrenchBoiethios you can't directly call clone on an arc
> The Arc::clone(&from) syntax is the most idiomatic because it conveys more explicitly the meaning of the code. In the example above, this syntax makes it easier to see that this code is creating a new reference rather than copying the whole content of foo.
 
Thanks, TIL
 
 
4 hours later…
1:06 PM
@DenysSéguret you can, but the community has decided the more explicit form is better
 
@trentcl yes. I think there are other form of references where you have to be explicit in order to prevent possible conflicts with the dereferenced thing, but I don't remember which one(s)
 
I don't personally see a problem with arc.clone(), but I accept the idiom
@DenysSéguret It can be ambiguous to the reader. The compiler will always find a clone method, but it might not be the one you want
Or so goes the logic. I don't really see it, as I mentioned.
 
1:31 PM
In a resource-conscious application, you want to know you are cloning light (Rc/Arc) not heavy (thing inside)
 
1:47 PM
@Shepmaster The only circumstance under which foo.clone() finds T::clone instead of Arc<T>::clone is when it's forced by explicit types elsewhere, in which case you can't avoid the "heavy" clone
Unless your types are wrong, in which case no compiler message can save you.
 
2:08 PM
@trentcl I don’t think it’s for that purpose, but the opposite. If you see a bare clone in code, you don’t know what’s being cloned without reasoning through the types. If you see Arc::clone you know immediately what’s being cloned.
I think this came from Servo where they tried to greatly reduce unnecessary cloning.
That is, foo.clone() might allocate a megabyte of RAM or it might not. Arc::clone definitely does not.
 
2:43 PM
@Shepmaster Except that foo.clone() resolves to Arc::clone when foo is an Arc, so it's not as if you could accidentally call the "heavy" version when the "light" version is possible
Do you have a particular scenario in mind? I've never been shown a motivating example for Arc::clone - not even a bad one.
 
@trentcl I think it's really just for human readers of the code.
Like, literally if you see foo.clone(), you don't know what is being cloned without becoming the compiler yourself.
 
As a human reader, I can confirm
 
2:59 PM
Ah, humans.
 
@Shepmaster Sure you do. It's foo. /s kinda
 
Oh, those humans.
 
3:38 PM
NGL, I'm pleased with myself that I could disprove the author of a crate about what their own crate can do.
(Really, they just read incorrectly, but still)
 
4:10 PM
My nascent idea for localized error messages ^
 
4:37 PM
TIL how to build an executable without an entry point and how to make the GCC linker segfault
 
@E_net4 no
no
don't do this.
 
@Shepmaster It's not like I wanted to. :v
 
@E_net4 I fix your problem. cargo update away
 
@Shepmaster So I noticed, nice. :>
 
4:54 PM
@E_net4 something only semi-related but that I'm proud of: SNAFU errors can be generic.
I remembered as I was writing the tests for your bug
#[derive(Debug, Snafu)]
enum VariantNamedSome<T> {
    Some { value: T },
}
 
:+1:
But I also like to live dangerously. Is there some kind of i686-none toolchain?
 
5:17 PM
Yes, I'm aware that UtcDatetime would work. However, just like for i32, i64, or String, I don't have to use bson::Bson::String or bson::Bson::I32 or bson::Bson::I64 in my structs, the serializer should take care of the conversion transparently. Adding variants over struct fields would also be an acceptable solution. — Nirman 1 hour ago
????????????????????
 
@Stargateur which part are you responding to?
 
All
 
They are saying they can put a String in the struct and it becomes a Bson::String automatically.
They want to put a chrono::DT and get a Bson::ISOTime automatically too
 
Well, use UtcDatetime Oo
 
But their whole point is that they want to store the chrono type in their struct
 
5:27 PM
UtcDatetime deref to chrono type
you need a warpper you can't implement serialize for a foreign type
so mongodb can't implemented serialize for DateTime<Utc>
and just use a wrapper already implemented by bson somehow
 

« first day (1648 days earlier)      last day (1844 days later) »