med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

354
active users

#rustlang

33 posts26 participants2 posts today

The next release of #RustLang will start warning about "mismatched lifetime syntaxes".

You can already automatically fix many of these cases by applying an auto-fix for the `elided_lifetimes_in_paths` warning:

RUSTFLAGS="-Welided_lifetimes_in_paths" cargo fix --all --all-targets

Joey Riches has been working on packagekit integration for moss so that we can have a nicer GUI experience for package installation of our stone based packages.

A short summary of his progress:

- Generated rust bindings for packagekit
- Wrote the moss backend for packagekit and implemented all functionality that moss supports
- Gnome software can list, install & update packages - working on getting a appstream catalog hosted for full functionality

TODO:

- Figure out C/rust interop story to minimise usage of unsafe
- Get support for misc. items implemented in moss such as repo origin of packages
- Get progress bar callback support in
- Implement support for remaining more niche packagekit filters e.g. newest, devel, basename, etc
- Figure out build system: integrate rust bindings & our backend upstream or develop it downstream for now?

It sometimes needs saying that we are fleshing out our distro from scratch, which means we are having to build new integrations like this from scratch. This is a good thing as we have been finding opportunities for optimisation across our code base, but it does require time.

#Rust #RustLang, #AerynOS #Linux #packagekit #GUI

Ok I'm tired... In #ratatui How Am I supposed to return a Span<'_> from a function ? Where does this lifetime comes from? #rustlang

everything is owned in my function:

fn display_battery_level(bat: f32) -> Span<'_> {
let bat_s = bat.to_string();
match bat {
_ if bat > 50.0 => bat_s.green(),
_ if bat > 25.0 => bat_s.yellow(),
_ => bat_s.red(),
}
}

Replied in thread

@kloetzl You can use a concept called "Borrow Splitting" in combination with scoped threads.

This way, your slices that your threads operate on, can have a lifetime shorter than 'static and you don't need to use #unsafe shenanigans. :ferris:

Please see this playground with comments on how to do this:
play.rust-lang.org/?version=st

On Borrrow Splitting:
doc.rust-lang.org/nomicon/borr

On scoped threads API:
doc.rust-lang.org/std/thread/f

play.rust-lang.orgRust PlaygroundA browser interface to the Rust compiler to experiment with the language

The latest issue of @thisweekinrust is out. We have included 3 issues in the “Call for Participation” section. If you are a Rust developer and want to help fix some issues in our project then please check them out.

These blog posts is a great way to learn about what is going on in the Rust world so definitely worth a read in general.

this-week-in-rust.org/blog/202

this-week-in-rust.orgThis Week in Rust 609 · This Week in Rust

Finished setting-up github access on my little Tauri app.
- oAuth login
- Use API to get repo info
- Clone repo
- Store the auth tokens in the OS credential manager so I don't have to login each time I start he app.

I'm pretty happy about the progress.

Rust is one of the few programming languages for which I don't feel the need to discover a safe/correct/comprehensible subset in which to write my code (except, of course, for "unsafe" which is declared as such, rather than needing to be discovered). This is part of the suitability of Rust for use in teams: there's no need to agree on, and police the use of, such a subset.

Hello instance!

Social media never looked interesting before but I'm having more and more the need to interact with people outside my physical bubble, both for diversity and for interest sharing, and mastodon looks great for that. At least I already found interesting people to follow.

I'm very keen on #anonymity, #privacy, #freedom and #empathy they are the cornerstones of a fair (even if not equal) society, IMO.

Also, #opensource #nerdstuff #rustlang #deregulation