1
-8
submitted 9 months ago by davidgs@tty0.social to c/rustlang@lemmyrs.org

JFC. When will open source projects like @rustlang learn that putting toxic people like this in positions of ANY authority is unacceptable. https://github.com/marshallpierce/rust-base64/issues/213 . He's showing you who he is, and you're not listening.

2
8
3
18
submitted 9 months ago by koka@lemmy.world to c/rustlang@lemmyrs.org
4
6
Qualifying Rust without forking (ferrous-systems.com)
submitted 9 months ago by koka@lemmy.world to c/rustlang@lemmyrs.org
5
19
submitted 9 months ago by koka@lemmy.world to c/rustlang@lemmyrs.org
6
-1
Why Not Rust Crypto? (briansmith.org)
submitted 9 months ago by thomask@lemmy.sdf.org to c/rustlang@lemmyrs.org
7
29
submitted 9 months ago by koka@lemmy.world to c/rustlang@lemmyrs.org
8
11
submitted 9 months ago by koka@lemmy.world to c/rustlang@lemmyrs.org
9
2
submitted 9 months ago by PCzanik@fosstodon.org to c/rustlang@lemmyrs.org

https://crates.io/crates/syslog-ng-common/0.7.0

The colleague, who added @rustlang support to #syslog_ng left many years ago. Syslog-ng #Rust support was last touched 7 years ago. Still, there are regular downloads. Just #searchengines or there are real users? Does it actually work?

10
34
submitted 9 months ago by koka@lemmy.world to c/rustlang@lemmyrs.org
11
17
submitted 9 months ago by njaard@lemmy.world to c/rustlang@lemmyrs.org
12
9
submitted 9 months ago by hattmo@lemmyrs.org to c/rustlang@lemmyrs.org

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.

13
16
submitted 10 months ago by Sibbo@sopuli.xyz to c/rustlang@lemmyrs.org
14
86
submitted 10 months ago* (last edited 10 months ago) by erlend_sh@lemmyrs.org to c/rustlang@lemmyrs.org
15
33
submitted 10 months ago by njaard@lemmy.world to c/rustlang@lemmyrs.org
16
72
submitted 10 months ago by typetetris@lemmyrs.org to c/rustlang@lemmyrs.org

From the release notes

Restore from-source serde_derive build on all platforms — eventually we'd like to use a first-class precompiled macro if such a thing becomes supported by cargo / crates.io

17
68
submitted 10 months ago by Sibbo@sopuli.xyz to c/rustlang@lemmyrs.org

serde_derive now ships a precompiled binary. This made a lot of people angry. The crate maintainer finally locked the issue.

18
19
std::any::Any for slices? (sh.itjust.works)
submitted 10 months ago* (last edited 10 months ago) by Kerfuffle@sh.itjust.works to c/rustlang@lemmyrs.org

I recently ran into an issue where I wanted to use Any for slices. However, it only allows 'static types (based on what I read, this is because you get the same TypeId regardless of lifetimes).

I came up with this workaround which I think is safe:

use std::{
    any::{Any, TypeId},
    marker::PhantomData,
};

#[derive(Clone, Debug)]
pub struct AnySlice<'a> {
    tid: TypeId,
    len: usize,
    ptr: *const (),
    marker: PhantomData<&'a ()>,
}

impl<'a> AnySlice<'a> {
    pub fn from_slice(s: &'a [T]) -> Self {
        Self {
            len: s.len(),
            ptr: s.as_ptr() as *const (),
            tid: TypeId::of::(),
            marker: PhantomData,
        }
    }

    pub fn as_slice(&self) -> Option<&'a [T]> {
        if TypeId::of::() != self.tid {
            return None;
        }
        Some(unsafe { std::slice::from_raw_parts(self.ptr as *const T, self.len) })
    }

    pub fn is(&self) -> bool {
        TypeId::of::() == self.tid
    }
}

edit: Unfortunately it seems like Lemmy insists on mangling the code block. See the playground link below.

T: Any ensures T is also 'static. The lifetime is preserved with PhantomData. Here's a playground link with some simple tests and a mut version: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3116a404c28317c46dbba6ed6824c8a9

It seems to pass Miri, including the mut version (which requires a bit more care to ensure there can only be one mutable reference). Any problems with doing this?

19
17
New features on lib.rs (users.rust-lang.org)
submitted 10 months ago by Vorpal@programming.dev to c/rustlang@lemmyrs.org

cross-posted from: https://programming.dev/post/1825728

Lots of new features!

Thought I should share this with those who don't use users.rust-lang.org. Note: I'm not affiliated with lib.rs, I'm only reposting to lemmy.

20
20
This Week in Rust 508 (this-week-in-rust.org)
submitted 10 months ago by Deebster@lemmyrs.org to c/rustlang@lemmyrs.org
21
13
This Week in Rust 507 (this-week-in-rust.org)
submitted 10 months ago by Deebster@lemmyrs.org to c/rustlang@lemmyrs.org
22
42
Bevy's Third Birthday (bevyengine.org)
submitted 10 months ago by Shatur@lemmy.ml to c/rustlang@lemmyrs.org
23
21
submitted 10 months ago by thomask@lemmy.sdf.org to c/rustlang@lemmyrs.org
24
17
submitted 11 months ago by tomtau@lemmyrs.org to c/rustlang@lemmyrs.org

Cackle is a tool to analyse the transitive dependencies of your crate to see what kinds of APIs each crate uses.

The idea is look for crates that are using APIs that you don't think they should be using. For example a crate that from its description should just be doing some data processing, but is actually using network APIs.

25
16
This Week in Rust 506 (this-week-in-rust.org)
submitted 11 months ago by Deebster@lemmyrs.org to c/rustlang@lemmyrs.org
view more: next ›

Rust Lang

3 readers
1 users here now

Rules [Developing]

Observe our code of conduct

Constructive criticism only

No endless relitigation

No low-effort content

No memes or image macros

No NSFW Content

founded 1 year ago
MODERATORS