@wholesomedonut it's interesting that they make such a big deal of it for Rust but with Golang for example, nobody seems to care.
Same as with Rust they add absolute paths of the files to print them during crashes. Not sure whether there's an option to remove that through.
But the point is, Go has quite a bigger user count and there nobody seems to care 🤔. And probably many other languages do the same.
Nonetheless it would be nice to have an option for this in the future.
@jonhoo thank you so much for this recording.
I used atomics from time to time already, just recently a few days back, and always use either Relaxed or SeqCst for the ordering.
This helped me a lot in understanding what the other ordering modes are for, although I don't "see" yet any personal use case for them so far. Maybe when trying to build synchronization primitives for learning purposes.
@klausi funny coincidence, I started using the same library today for some experiments.
It's indeed very easy to use and gives great results with just a little bit of code.
@musicmatze I saw you already pushed a new release. This is a great crate and I'm glad somebody picks it up and continues work on it. A new release was long overdue 👍
@wizzwizz4 maybe the derive_more crate can help you reduce some boilerplate on your enums:
@deshipu Just because somebody puts things on your to-do/issue tracker doesn't mean you actually have to do it.
After all it's your project so you can just tell them to pay you or don't expect the issue to be handled anywhere soon.
@kura it would be Result<Vec<_>> in that case. You have to make sure that the same result/error is used within the closures so eventually you have to add some type annotations.
@kura you can collect into a Result directly as the Result type can be created from an iterator.
It's a bit low level so you'll have to handle inputs yourself which is actually done by the backend library that you pick. You will have to build input dialogs and stuff yourself.
Another one is cursive https://crates.io/crates/cursive
It comes with tons of widgets built in and make input handling very easy. I personally don't like the API though as you end up in callback hell and tons of Arc wrapped data.
@sotolf a small tip for the crates you're currently using: I saw you import `reqwest` and I guess you plan on using that to query the Wallhaven API?
So `reqwest` is a really great http client but it uses async/await features and that topic is a bit complex in Rust.
As you are just starting with rust I would recommend you `ureq` or `attohttpc` as alternative because they don't require an async/await runtime and therefore a little bit more beginner friendly.
@sotolf if you just need to list all things in a dir non-recursively then read_dir should be fairly sufficient
If you want to iterate recursively there is a convenient crate for it:
In case you have any trouble with the APIs, feel free to ask 🙇♂️
@schlink you don't even need to allocate a Vec for this and can directly use a simple array:
With that you can switch scenes, adjust scenes items and all kinda sorts of stuff directly from #rust (all the heavy lifting done by obs-websocket though, this is a client library for it).
You can listen for events (created by user interactions) as well.
@kornel this is great. Currently exactly my biggest (and actually only) pain point when building docker images for rust projects. Especially on sometimes slow network connections it can take several minutes sometimes up to 10-20 minutes even.
I'm really happy to see this and hope for it to be approved and implemented. Thank you for this proposal 🙏
. ⠀⠀⠀✦ ⠀ ⠀ ⠀⠀⠀⠀⠀* ⠀⠀⠀. . ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀✦⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀☄️ ⠀ ⠀⠀⠀⠀⠀⠀. . ﾟ . . ✦ , .
. . ✦⠀ , *
⠀ ⠀ ,
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀. ⠀ ⠀.
˚ ⠀ ⠀ , .
*⠀ ⠀ ⠀✦⠀
. . ⠀🌕
˚ ﾟ .
.⠀ . .
✦⠀ , 🛸 ⠀
. ⠀ .
˚ ⠀ ⠀ ,
. ⠀ . ⠀⠀⠀⠀⠀⠀. ⠀⠀⠀✦ ⠀ ⠀ ⠀⠀⠀⠀⠀* ⠀⠀⠀. . ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀✦⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀☄️ ⠀ ⠀⠀⠀⠀⠀⠀. . ﾟ .
@reconbot in a last year's challenge I first solved it with Rc + RefCell and later realized that I could do it without by changing the data structures. The speed improvement was about 40x.
It's definitely interesting to do once with Rc + RefCell once 👍
@reconbot you are trying to solve the advent of code day 7 challenge right?
I had similar problems with challenges that seem to want you to build a graph/tree like structure. You can do that with Rc + RefCell but it will be quite a bit slower and often you don't need a whole tree with parent/child relations but often just one direction.
If you want I could give you some hints about how I solved it but I'm worried I might spoiler you too much.
🦀 Rust, 🐹 Go and 🍵 Kotlin enthusiast
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!