Details
-
AboutAAAAAAAAAAAAAAAAAAA
-
SkillsRust and other things
-
Locationhere
-
Website
Joined devRant on 12/8/2018
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
Both evaluate truthyness, but the first one explicitely "casts" it into a bool
E.g.
let notEmpty = someString; // notEmpty is a string
let notEmpty = !!someString; // notEmpty is a bool
If used in an if condition or with other boolean operators it doesn't matter since they automatically coerce it into a bool -
@antigermgerm That's what it's for. It's essentially a way better C (and thus also without some of the higher level C++/Rust niceties like RAII)
Quite an interesting lang -
@jestdotty Hit me up tomorrow im waaay too drunk right now :D
Not sure if actors make sense though. But you NEED to do something about those Arc<Mutex<T>>. Those are killing your code, at least to some degree -
@jestdotty I get what you mean with the and_then() + .ok().... Yeah it can be annoying. You could rewrite it into a single and_then with the two conversions followed by the ? operator, but that doesn't improve it much (https://play.rust-lang.org//... )
For your new problem, yeah those signatures are cuuuursed :P
Async rust can be hard
Though I believe a lot of those 'static and Send bounds are required because tokio requires those. I've heard other executors are more lenient (but also only can run the future on the spawning thread)
As for Arc<Mutex<T>>: I think this is pretty much always a code smell. As you probably notice in your code, it results in a LOT of .lock().unwrap() which is giga ugly and also just leads to deadlocks
I think its best for async rust apps to do more of an actor pattern kinda like go, where many independent single-thread actors communicate over channels
My 2 cents :P -
@cafecortado Spoilers :(
I wanted to hear his scam pitch -
@jestdotty Can you post the snippet that annoys you?
-
@jestdotty I meeaaaaan depends on what you're doing
Rust is plenty logical but some things can be a hassle sometimes
Can't really say much more without knowing anything about your code -
(btw the try operator can do type conversions if you have the right From impls, then you don't need to manually map_err)
-
Being forced to handle both the happy and the error path is whats makes rust great though
-
You say you are depressed and then you post rage bait to beef with people leading to even more negative emotions
What the fuck is actually wrong with you. Anger and hate seems to be the only thing driving you -
Something something trans joke
-
In that case, she's not really wrong ¯\_(ツ)_/¯
-
@Wisecrack Considering its a wednesday and im getting drunk as fuck I think you can piece together whether im an alcoholic or not ;P
(Aware) -
@Wisecrack Its not looking good im just gonna be honest
-
Im too drunk to understand what you're saying :D
-
@antigermgerm Not even a loli joke as a comeback, boring 😴
-
@Lensflare Noticed that as well lol
-
@whimsical ;P
-
Jetbrains IDEs are pretty damn good
-
@antigermgerm I don't think you understand hyperbole, which isn't surprising considering it takes an IQ above 80
-
@antigermgerm Industry has literally nothing to do with population you retard. There could only be 1 chinese person on this planet and they would still build 20 coal platnts per day
-
@antigermgerm And germany is 1.49%
What's your point again? -
Like 90% of global CO2 is produced by india and china
And because of fucking retards like you crying about CO2, the west is becoming more and more untenable for industry, causing them to outsource more and more to china which results in even more CO2 production
Good job! When the west has lost all wealth and status in the world and china constructs a global dictatorship we can at least pat each other on the back because we were so good and moral people. Saving that 1% global CO2 to save the world!
Fuck, i hate normies so much -
@Liebranca https://uops.info/table.html/... says 32 bit pext takes around 19 cycles. Considering bitwise ops you'd use to emulate that often take half a cycle, you can do like 38 instructions...
https://github.com/zwegner/zp7 has a polyfill which is pretty smart -
3 years for attempted murder is insane injustice and shows how privileged women in the west are, holy hell
-
@BordedDev Coffee makes me doodoo, unfortunately :(
-
Unironically why AI doesn't work as well as some people would like to believe
If you're too lazy to write code you're also too lazy to write good prompts, so your code will suck either way. Theres no magic way to create good code! -
@whimsical Okay not you've crossed the line
I like java, don't call me a java hater! :P -
@whimsical True to the devrant legacy I only upvote people I agree with or find funny
Your comments are often so abstract I don't even know what to think about them lol -
@antigermgerm I'm sure you're a good ol german with a german pass. Very german with everything that makes any german, I would never doubt that there was anything non german about you, my german brother
