I'm working on a cli for a service I've made that maintains a node edge graph (think neo4j type thing). I want to be able to display a graph in the terminal in a sort of ascii art text form kinda like git log -graph. I haven't found any third part libraries that can do that and am looking for help.
- @balp to
Rust: Support English - •
- github.com
- •
- 15d
- •
As one more step in learning rust. I have done the Tennis Game Kata. There are a few tradeoff as some names being shorter than optimal, but by that preventing line breaks. That gives better overview.
Is there any rust constructions that would help making the code more readable?
Is there a cleaner solution to get the test parameterized?
Would there be a better fitting rust types for the functions? I started with the interface from [Dani Pardo](https://github.com/danipardo), in Emily Baches [refactoring kata](https://github.com/emilybache/Tennis-Refactoring-Kata).
- @balp to
Rust: Support English - •
- github.com
- •
- 15d
- •
- @nuscheltier@feddit.de to
Rust: Support English - •
- 2M
- •
Hey there,
I'm trying to figure out licenses. My problem is that I want to showcase or make a portfolio out of my small projects on Gitlab (so as a private person without commercial interests) but I also don't want to the source code to be used commercially. (Yeah, I know. It's kinda arrogant to think that anyone would be interested in such small projects, but indulge me please.) Something along these lines:
* Software is provided as is
* Use if you want
* Contribute if you want
* Don't take credit
* Don't sell
From what I read Creative Commons BY-NC(-SA) would be the goto but they advice against using it for software, since there are enough already (that's the gist I got from it). Reading about software licenses I found the Common Clause that seems to be like what I want to have.
But here comes the catch: If I want to use for instance `clap`, how do I go about it? Clap has a dual license model from what I understand: Apache-2 and MIT. Are they even compatible with Common Clause? Can I use `clap` if I use Common Clause and provide the license for `clap`?
All this legalese is tiring and wearing me out. Can anybody help me, and perhaps ELI5?
Thank you.
- @maiskanzler@feddit.de to
Rust: Embedded Systems English - •
- youtu.be
- •
- 2M
- •
Hey, just found this gem of a video and thought I'd share. Covers a great deal of information about embassy and the pico within the first two and a half minutes and is nicely paced overall!
- @it_a_me to
LemmyRS: Meta English - •
- 2M
- •
I'd like to stick with the lemmyrs instance but we are almost a full majver out of date. Is there any timeline for updates or should I just migrate?
- @it_a_me to
LemmyRS: Meta English - •
- 2M
- •
Deebster to Rust: News English- •
- this-week-in-rust.org
- •
- 1M
- cross-posted to:
- rustlang
@erlend_sh to Rust Lang English- •
- blog.erlend.sh
- •
- 1M
- •
Cross-posted to Reddit: https://www.reddit.com/r/rust/comments/162keij/transitioning_rrust_to_the_threadiverse/
Deebster to LemmyRS: Meta English- •
- 1M
- •
Hi all, I got in touch with the admin and he's alive but snowed under. As you may know, there's been a few update attempts that have failed, which is why we're still on v0.17.4.
[@admin@lemmyrs.org](https://lemmyrs.org/u/admin)'s reply follows:
> I am aware of the concerns rightfully raised by the community on lemmyrs, I'm at a loss to be honest since I cannot dedicate the time and resource to upgrade the instance to the latest version without a) significant down time b) potential loss/corruption of the existing database.
> I'm not sure if I've made you admin but I'd appreciate if you could relay this information to the community on lemmyrs. My personal (and professional) life have been...chaotic to say the least which is why I haven't been able to make any thoughtful update on lemmyrs.
> I'm going to try again this coming weekend to upgrade lemmyrs over to whatever is the latest version of lemmy is (I'm not hopeful though since many of my attempts have ended in failure to do so).
> The server is back up and running fwiw.
Deebster to LemmyRS: Meta English- •
- 1M
- •
Peter Czanik to Rust Lang- •
- 8d
- •
[https://crates.io/crates/syslog-ng-common/0.7.0](https://crates.io/crates/syslog-ng-common/0.7.0)
The colleague, who added [@rustlang](https://lemmyrs.org/c/rustlang) support to [#syslog\_ng](https://fosstodon.org/tags/syslog_ng) left many years ago. Syslog-ng [#Rust](https://fosstodon.org/tags/Rust) support was last touched 7 years ago. Still, there are regular downloads. Just [#searchengines](https://fosstodon.org/tags/searchengines) or there are real users? Does it actually work?
- @thomask@lemmy.sdf.org to
Rust Lang English - •
- 3M
- •
In the interest of sparking a little discussion (not too spicy please, we're having a nice clean start here) I thought I would ask the question. It's something I'm legitimately wondering about as someone who has reached for tokio by default for years.
I'm aware of async-std and smol, probably unaware of others. If you've used or prefer a different async runtime, what trade-offs might I be interested in or what features am I missing out on?
Deebster to Rust Lang English- •
- this-week-in-rust.org
- •
- 3M
- •
I always forgot to check these unless I saw them in /r/rust so let's start posting them here. This is last week's since there's a day or two till the next.
Deebster to Rust Lang English- •
- this-week-in-rust.org
- •
- 3M
- •
- @jasory to
Rust Lang English - •
- github.com
- •
- 3M
- •
I originally wrote this a few months back, but I have done some work to let the algorithm be easily reproducible, as well as added some features to allow reduced memory (not-so-optimal) variants.
Currently favicon (circled R) looks similar to the one used for internals.rust-lang.org or users.rust-lang.org.
Maybe Lemmyrs should have a distinct favicon (website tab icon), for example, circled "L" instead of circled "R"?
// Cannot post it to Meta community instead: UI hangs
- @danyel@programming.dev to
Rust Lang English - •
- 3M
- •
cross-posted from: https://programming.dev/post/24889
> [Disclaimer: Lemmy newb here]
>
> There are currently 3 Rust communities across 3 instances: programming.dev, lemmyrs.org and this one (lemmy.ml). I know it's still very early for the migration from /r/rust, but it would split the community if there are so many options and nobody knows which is the "right" one. Currently this community has the most subscribers, but it would make sense if the Rust community finds its new home in one of the other instances.
>
> - lemmyrs.org seems like the logical solution if instance-wide rules are paramount and "non-negotiable"
> - personally I would love a programming-centric instance and programming.dev seems like a good way. Rust is not the only language I'm actively using (unfortunately :)). Maybe there can be community-specific rules that "enforce" the Rust CoC and the Rust community can find a home there?
>
> Either way, the current situation has the most negative impact.
>
> Thoughts?
lemmyrs to LemmyRS: Meta English- •
- 3M
- •
Hey everyone, thought I'd post some stats since we're one week old now!
From Vultr (instance is hosted through them):

```
Total applications: 116
Denied applications: 4 (one person asked to change username, 3 others gave one word answer to the application question)
Accepted applications: 112
```
docker stats (snapshot):
```
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7f365c848236 caddy 0.19% 43.22MiB / 969.4MiB 4.46% 7.23GB / 7.65GB 631MB / 146MB 8
d9421a5d930a lemmy-ui 0.00% 49.62MiB / 969.4MiB 5.12% 1.51GB / 3.32GB 869MB / 1.26GB 11
e8850c310380 lemmy 0.08% 52.53MiB / 969.4MiB 5.42% 5.67GB / 5.86GB 942MB / 582MB 8
7ebb13fde277 postgres 0.02% 304.2MiB / 969.4MiB 31.38% 908MB / 2.97GB 3.82GB / 14.4GB 12
9b471baacf84 pictrs 0.05% 10.32MiB / 969.4MiB 1.06% 53.5MB / 1.18GB 653MB / 360MB 14
```
df -h:
```
Filesystem Size Used Avail Use% Mounted on
tmpfs 97M 1.7M 96M 2% /run
/dev/vda1 24G 12G 11G 53% /
tmpfs 485M 0 485M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 97M 4.0K 97M 1% /run/user/1002
```
lemmyrs to LemmyRS: Meta English- •
- 3M
- •
- @pohart to
LemmyRS: Meta English - •
- 3M
- •
I can consistently access a couple of tech communities at beehaw.org, but consistently cannot access politics@beehaw.org or news@beehaw.org.
Is this by design, or is it growing pains? I'm willing to wait if it's likely to get fixed but I'll get another account elsewhere if that's just how our federation is set up.
- @pohart to
LemmyRS: Meta English - •
- 3M
- •
Hey LemmyRS,
I decided to try and change the style of the website to make it as accessible and appealing as I could through dev tools (inspect element).
Here are my results
Current:

After changing:

I thought this would help foster discussion on how we can improve this instance to look both appealing and accessible for supporting the most users for our growing community!
Let me know what you think!
- @danyel to
Rust: Support English - •
- 3M
- •
I've been using lazy_static until now but was trying to migrate to OnceCell.
It seems I can't have a OnceCell<Regex> even though I'm never calling mutable methods on the regex. I'm not even using multiple threads.
The error I'm getting is:

Any way to solve this or do I have to use OnceLock / continue using lazy_static? I don't want to add the overhead of using OnceLock if not necessary.
@Kaiser@lemmy.world to Rust Lang English- •
- 3M
- •
Has anyone managed to build the proj crate, I've tried on windows and on Ubuntu but always seem to have some problem with the proj-sys crate building proj from source.
[disclaimer: initially posted on Reddit r/rust]
[*unrar*](https://docs.rs/unrar) is a library for listing and extracting RAR archives.
Hi lemmyrs!
Almost 8 years ago, I release my first Rust crate. Today, before I leave *Reddit* at the end of the month due to the recent controversy, after months and years working on and off on this update, as a parting gift, I'm happy to announce the crate's biggest release ever. This really is a milestone release that, among others, allows one to extract files directly into memory -- something people have been asking forever how to do.
I've also completely rewritten major parts of the library and am very proud of the way things are looking right now. Utilizing the typestate pattern, the library enforces correct usage at compile time, only exposing methods when they make sense (depending on a combination of [open mode and current cursor position](https://docs.rs/unrar/latest/unrar/#openarchive-cursors)).
Before this release, the library was hard to use and it was not possible to skip some files in the archive while, for instance, extracting others. One operation had to be chosen for *all* files. That has changed now. However, the drawback is that iterating archives is now a bit harder since the `Iterator` trait is not implemented for archives that are opened in `Process` mode (since it's hard to enforce an operation at call-site). I have a few ideas how to improve this going forward but input is also always welcome.
Anyway, this sets the groundwork architecture and paves the way forward for upcoming releases where ergonomics and other improvements like error types can be the focus.
Another major focus of this release was *documentation*: all API items are documented now except for very few exceptions. The crate docs also features a very extensible introduction as well.
GitHub repository can be found here: https://github.com/muja/unrar.rs
Feel free to discuss / ask questions here or over on Reddit.
Thanks!
@erlend_sh to LemmyRS: Meta English- •
- 3M
- •
Several people post about #rust and #rustlang on the fediverse. Could those posts be automatically pulled in here, e.g. into a dedicated community instance?
- @icesentry to
Rust Lang English - •
- survey.stackoverflow.co
- •
- 3M
- •
They changed most loved to most admired, but it used essentially the same question.
At this point I lost count how many years this has been going on.
lemmyrs to LemmyRS: Meta English- •
- 3M
- •
Hey all,
Just thought I'd share an update. I have added a few new communities and renamed the existing communities to have slightly more consistent naming throughout this instance. Icons are primarily from Wikimedia Commons (replacements welcome as long as there are no copyright issues).
Added:
```
- Rust: Web Development
- Rust: Game Development
- Rust: Embedded Systems
```
Renamed:
```
- Memes to Rust: Memes
- News to Rust: News
- Support to Rust: Support
- Meta to Rust: Meta
```

PS: The identifiers for the renamed communities remain the same. Open to any suggestions/thoughts on this change or otherwise.
Cheers!
lemmyrs to LemmyRS: Meta English- •
- 3M
- •
Deebster to Rust: Memes English- •
- 3M
- •
# Image Transcription: Meme
['Phil Swift Slaps on Flex Tape'. Top image shows Phil Swift, a person wearing a black shirt and jeans, holding a piece of tape in his hand while facing a large water tank with a hole that is leaking water quickly.]
Phil Swift: RUSTC
Leaking water tank: SELF-REFERENTIAL STRUCTS
[Bottom image shows Phil's hand slapping the piece of tape over the leak.]
Tape: USIZE
Deebster to Rust: Memes English- •
- 3M
- •
Deebster to Rust Lang English- •
- this-week-in-rust.org
- •
- 3M
- @provisional@lemmy.sdf.org to
Rust Lang English - •
- 3M
- •
cross-posted from: https://beehaw.org/post/570507
>After [the (temporary) defederation announcement of earlier](https://beehaw.org/post/567170) i checked [the Lemmy repo](https://github.com/LemmyNet/lemmy/issues) to see if there was already a ticket on the federation limiting option like Mastodon’s that people mentioned Lemmy doesn’t yet have. Not only i didn’t find it, i also saw that there’s about 200+ open tickets of variable importance. Also saw that it’s maintained mostly by the two main devs, [the difference in commits between them and even the next contributors is vast](https://github.com/LemmyNet/lemmy/graphs/contributors). This is normal and in other circumstances it’d grow organically, but considering the huge influx of users lately, which will likely take months to slow down, they just don’t have the same time to invest on this, and many things risk being neglected. I’m a sysadmin, haven’t coded anything big in at least a decade and a half beyond small helper scripts in Bash or Python, and haven’t ever touched Rust, so can’t help there, but maybe some of you Rust aficionados can give some time to help essentially all of Lemmy. The same can be said of Kbin of course, although that’s PHP, and there is exacerbated by it being just the single dev.
- @thomask@lemmy.sdf.org to
Rust Lang English - •
- github.com
- •
- 3M
- •
Look out for your linter if you're tracking nightly. :)