I have changed it to use std::path::PathBuf and it's working fine for me now.
Huge thanks for friendly hint and looking at my code.
I'd like to parse ipv4 addresses given as command line argument values.
I have got two arguments accepting ipv4 address.
If I specify single such option all is fine.
If I specify both, I 'm getting error like this:
thread 'main' (624061) panicked at /home/peto/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-3.2.25/src/parser/matches/arg_matches.rs:1879:13:
Must use `Arg::allow_invalid_utf8` with `_os` lookups at `[hash: A8F400C40154F09]`#[tokio::main]
async fn main() -> Result<(), Error> {
let mut app = App::new("Server APP")
.about("My super cool app")
.setting(AppSettings::DeriveDisplayOrder)
.setting(AppSettings::SubcommandsNegateReqs)
.arg(
Arg::with_name("socket")
.required(true)
.takes_value(true)
.long("socket")
.help("Unix socket path"),
)
.arg(
Arg::with_name("relayaddress")
.required(false)
.takes_value(true)
.long("relay-address")
.value_parser(value_parser!(Ipv4Addr))
.help("External relay ipv4 address used together with --listen-address to run behind a nat"),
)
.arg(
Arg::with_name("listenaddress")
.required(false)
.takes_value(true)
.long("listen-address")
.value_parser(value_parser!(Ipv4Addr))
.help("Local listen ipv4 address used together with --relay-address to run behind a nat"),
);
let matches = app.clone().get_matches();
if matches.is_present("relayaddress") & matches.is_present("listenaddress") {
let external_ip = IpAddr::V4(matches.get_one::<Ipv4Addr>("relayaddress").expect("Invalid address"));
let local_ip = IpAddr::V4(matches.get_one::<Ipv4Addr>("listenaddress").expect("Invalid address"));
println!("Listening on local IP: {local_ip}");
println!("Relaying through external IP: {external_ip}");
}}
```
Tarmageddon is a great example of why RUSTSEC tracks unmaintained crates/libraries and why such unmaintained projects are very much security-relevant: edera.dev/stories/tarmageddon
#rust
Edera uncovers TARmageddon (CVE-2025-62518), a Rust async-tar RCE flaw exposing the real dangers of open-source abandonware and supply chain security.Edera
Do I know any people who know #rust pretty well? Do you dare speak up?
Why do I get the numbers I get here?
github.com/Spindel/tokio-timeo…
Comparing tokio's timeout vs. other solutions. Contribute to Spindel/tokio-timeout-compare development by creating an account on GitHub.GitHub
Unfortunately, I've mostly lost interest and motivation to work on Helvum, so the project has already been inactive for over a year. I am now marking...GitLab
All the Rust Core Type System
This weekend project (yes, another one instead of finishing the 100 others) is a #fastcgi handler to implement xep-0070, alnowing to use an #xmpp account to log in to a website. Writing it in #rust as a learning exercise.
I hope to replace "login with google" and the other things I had to add to my website ovwr the years in order to not store people's passwords. This should allow to do it in a decentralized way without forcing any specific provider.
Wanted: a #RustLang tool with 4 panes:
- desired generated code
- an in progress proc-macro being written
- input #Rust code where the proc-macro is being applied
- a live updating view of the actual generated code with diff annotations against what was desired
If you want to go fancier, tie things in the output to the input and provide suggestions on where things are missing pre-expansion for the output to march the expectation. I feel like 90% of this can be accomplished today with tmux+a file watcher+direct rustc invocations using -Zunpretty=expanded, but it'd be lovely to have an actual tool for this.
I used to use #OCaml quite a bit, though that was a number of years ago, and I use #Rust a lot now.
One of my main gripes about OCaml is how it wasn't very practical in some ways. There was no way to open a file read/write (very common for, say, databases), and because it lacked things like Haskel's typeclasses or Rust's traits, you'd use different functions to seek on a file opened for input vs. one for output.
Looks like it's still the same.
The #Rust #compiler #performance #survey 2025 only runs until next Monday, 7th July - so fill it if you haven't yet and help the Rust project make us Rust developers more productive! 🚀
blog.rust-lang.org/2025/06/16/…
Empowering everyone to build reliable and efficient software.blog.rust-lang.org
I am slowly oxidizing my unix CLI. A lot of people have made rust based versions of common unix utilities and some of them are REALLY good.
Like fd-find for doing essentially find . -name blah. And rg (ripgrep) which does grep -R but it's aware of git, files like pyc or .bak files, and it excludes them by default.
Now I have sd which is hopefully replacing the last thing I used perl for. I write perl -pi -e s/x/y/g a lot. Just doing a quick string replace inside a file. So sd can start doing that.
I'm also trying to get used to zellij instead of tmux and starship for modern prompt decorations like the kids do.
These kids, my friends, are welcome on my lawn.
Rust Solves The Issues With Exceptions
home.expurple.me/posts/rust-so…
A small topic that’s too big to fit in a larger Rust post.Dmitrii Aleksandrov
Our latest Thunderbird + Rust Office Hours video is up! In it, @brendan explores how Rust (along with a little C++) is powering our push to provide support for Microsoft Exchange. Learn more and find how to get involved!
The Rust GCC backend can now fully bootstrap the Rust compiler. Excellent work from FractalFir in their GSoC (which starts in one week XD).
More information here: reddit.com/r/rust/comments/1kt…
for index in -4..12 {<br> println!("cat: {}", cats[index]);<br>}<br>
🦀 Flattening #Rust's Learning Curve | corrode
「 Your learning pace doesn’t have much to do with whether you’re smart or not or if you have a lot of programming experience. Instead, what matters more is your attitude toward the language.
I have seen junior devs excel at Rust with no prior training and senior engineers struggle for weeks/months or even give up entirely. Leave your hubris at home 」
corrode.dev/blog/flattening-ru…
I see people make the same mistakes over and over again when learning Rust. Here are my thoughts (ordered by importance) on how you can ease the learning process. My goal is to help you save time and frustration. <…Corrode Rust Consulting
please, instead of reading the blog post by someone getting "scared" by "rust's dependencies" after running some line count tool, read this more informative article instead
New Blog Post:
Rust's Error Messages are Great
Examples of some of the best parts of #rust error messages. (You don't need to know rust to understand them.)
alanwsmith.com/en/2w/dt/w8/ce/
[cc: @mahryekuh who inspired this post by asking if there were error messages I liked.]
new security milestone reached: #chatmail relay servers are hardened to only transfer end-to-end encrypted e-mail with metadata minimization. No cleartext message can enter or leave the secure chatmail network anymore.
We now talk about "chatmail relays" rather than servers as they only ephemerally store messages until delivery. Dirt cheap to run.
We opened up our #rust "chatmail core" infrastructure library and set up an overview of the community driven ecosystem ...
Chatmail provides FOSS infrastructure for interoperable, secure, speedy and reliable end-to-end encrypted messaging. Check out clients as Arcane Chat, Bots or Delta Chat today!chatmail.at
So, we did a thing.
github.com/systemd/systemd/pul…
This PR introduces two new changes. A Go Library systemd is an important set of libraries and utilities on modern Linux systems. The need to remove C in favour of memory-safe alternative is of peak...GitHub
Long shot but worth it. I think I may have found my blocker for using #NixOS on my laptop/dev machines and am looking for help.
In short, I have multiple #Rust projects that build on the CLI just fine but not in VS Code/Rust Analyzer. I didn't spot this until very recently when I realized problems in my own code weren't being highlighted but compiled crates worked just fine.
Seems RA can't find some libraries but to the best of my abilities I've made those libraries available to the shell. I also launch code . from the terminal so it should have the environment set up correctly without need for Nix-specific extensions.
It's been suggested I not use the code-fhs Nix package, but that means starting from scratch and fixing existing extensions which work.
Please don't suggest abandoning VS Code or substantially changing my accessible workflows unless you also have 12 extra hours per day for me. Also please don't suggest abandoning Linux entirely--this issue is NixOS, not Linux.
More context: discourse.nixos.org/t/rust-pro…
Hey folks, seems like every time I think I’m starting to figure things out, I hit a new wrinkle. 🙂 I’ve been trying to move various projects to devshells.NixOS Discourse
Wow. #Rust is an unserious language. Unless you bend over backwards to fight the compiler and avoid the standard library, you cannot write code that doesn't try to terminate the calling process on arbitrary error conditions. news.ycombinator.com/item?id=4…
Terminating the process is never an appropriate action in a library. The library has no way to know its caller's uptime constraints. Libraries should only return error codes to callers. Only applications can decide whether to bail out or not.
Last week we had our first! Thunderbird + Rust office hours with our back-end developer @brendan and Sr. DevRel Engineer @linuxflower giving us a great introduction to the past, present, and future of oxidization in Thunderbird. Watch the recording on our @tilvids channel and find out how to get involved!
the clarification is in a blog post, that may not be legally binding. so in my eyes any clarification outside of the ToS is worthless.
If #Mozilla wants to offer AI services or collect and use their users data, this should be a separate opt-in ToS in my opinion, not the terms of the base application.
But TBH #Mozilla is doing too much dumb management decisions these days, so I'm considering to stop recommending it. (colorways, firing #rust and #servo teams, ads for temu and so on)
** Announcement ** Check out all the selected speakers for RustWeek 2025!
See rustweek.org/speakers/
Also see the schedule for both conference days:
Tue: rustweek.org/schedule/tuesday/
Wed: rustweek.org/schedule/wednesda…
You're invited to our inaugural Thunderbird + Rust Office Hours! Join us on Wednesday, February 19 at 20:00 UTC. Find out all the info on our Developers mailing list: thunderbird.topicbox.com/group…
Happy I Love Free Software Day! 💕
Unfortunately, this year I could not join nor organize any in-person celebration, BUT of course I want to share my gratitude to the many, countless #FreeSoftware services I don’t merely use, but actually depend on.
Last year, I decided to focus only on #YunoHost, because it would have been crazy to list all the projects I use and I love.
This time, even if I will most certainly forget someone, I am challenging myself to mention all the #LibreSoftware my life is powered by.
Without further ado, THANK YOU to:
Lastly, but most importantly, the biggest thank you goes to all the free software libraries and dependencies the above mentioned #software are made of/built with, including #C, #JavaScript, #Python, #Rust, and all community-maintained programming languages.
I am super sorry if I forgot someone!
#OpenSource #ILoveFS #SoftwareFreedom #Fairphone #Android #LineageOS #FSFE #OpenStreetMap #PhotoPrism #LibreOffice #Readeck #Eleventy #11ty #GNOME #Signal #forgejo #Codeberg #MusicBrainz #ListenBrainz #MetaBrainz
Information and insights concerning the configuration and maintenance of Tommi’s server.Tommi (Tommi’s mind)
I'm currently looking for a remote software development job
I have plenty of experience making software using all sorts of languages, frameworks and tools. Tho I have the most experience with Rust, C++, C#. I also usually do native cross platform applications and backend.
You can find my full CV on my website luna.graphics
#GetFediHired #JobSearch #RemoteWork #Rust #Rustlang #CPP #CSharp #Backend
Interested to take a little tour through how #deltachat apps and the #rustlang core library are wired together?
@treefit and @WofWca provide a deep-dive into the history of apps migrating from a C-Foreign-Function-Interface to a #Rust based JSON-RPC mechanism, with entertaining horror stories like how an iOS release some years ago could delete profiles without the user intending it 😬
The post also highlights a few areas where folks interested to help could start ... delta.chat/en/2025-02-11-why-j…
Foremost this is a quite technical post. Read our other blog posts if you want something more targeted at end users. If you have not yet looked at the Delta Chat source code, you might not know tha...delta.chat
✨ My first technical blogpost is out now. ✨
If you ever wanted to learn a bit about how
#deltachat works internally and why we have two ways to communicate with our #rust core, then this is the introduction to read
delta.chat/en/2025-02-11-why-j…
#jsonrpc #cffi #c #rust #deltachat_desktop #deltachat_core
Foremost this is a quite technical post. Read our other blog posts if you want something more targeted at end users. If you have not yet looked at the Delta Chat source code, you might not know tha...delta.chat