1
-7

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
17
submitted 1 year ago by koka@lemmy.world to c/rustlang@lemmyrs.org
4
7
Qualifying Rust without forking (ferrous-systems.com)
submitted 1 year ago by koka@lemmy.world to c/rustlang@lemmyrs.org
5
19
submitted 1 year ago by koka@lemmy.world to c/rustlang@lemmyrs.org
6
-1
Why Not Rust Crypto? (briansmith.org)
7
28
submitted 1 year ago by koka@lemmy.world to c/rustlang@lemmyrs.org
8
13
submitted 1 year ago by koka@lemmy.world to c/rustlang@lemmyrs.org
9
2

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
35
submitted 1 year ago by koka@lemmy.world to c/rustlang@lemmyrs.org
11
18
submitted 1 year ago by njaard@lemmy.world to c/rustlang@lemmyrs.org
12
8
submitted 1 year 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
15
submitted 1 year ago by Sibbo@sopuli.xyz to c/rustlang@lemmyrs.org
14
85
submitted 1 year ago* (last edited 1 year ago) by erlend_sh@lemmyrs.org to c/rustlang@lemmyrs.org
15
33
submitted 1 year ago by njaard@lemmy.world to c/rustlang@lemmyrs.org
16
72

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
67
submitted 1 year 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 1 year ago* (last edited 1 year 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)

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
19
This Week in Rust 508 (this-week-in-rust.org)
21
13
This Week in Rust 507 (this-week-in-rust.org)
22
41
Bevy's Third Birthday (bevyengine.org)
submitted 1 year ago by Shatur@lemmy.ml to c/rustlang@lemmyrs.org
23
21
24
17
submitted 1 year 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)
view more: next ›

Rust Lang

2 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