1
33
2
15

I've always been curious about this. If I were to take a snapshot of a git repo at a particular point in time, who would be the top contributors by active lines of code? And then, what type of files have they contributed the most? So I built this little tool.

I've been wanting to learn rust for quite some time now and this was one of my first projects in it. It was a lot of fun!

It uses git under the hood to obtain the information and it's nothing fancy, but keen to hear what you think.

3
8
submitted 3 days ago* (last edited 3 days ago) by xameer@mathstodon.xyz to c/rust@programming.dev

#rust analyzer question for #emacs folks
In client more I see run and debug
But gui emacs I don't ..
why
pfa

@rust

4
58
submitted 5 days ago by orsinium@lemmy.ml to c/rust@programming.dev
5
42
submitted 5 days ago by orsinium@lemmy.ml to c/rust@programming.dev
6
19
submitted 6 days ago* (last edited 6 days ago) by thevoidzero@lemmy.world to c/rust@programming.dev

Hi all.

I want to develop a plugin system within my program, and I have a trait that functions defined by plugins should implement.

Currently, my code gets all the functions in a HashMap and then calls them by their name. Problem is, I have to create that hashmap myself by inserting every function myself.

I would really appreciate it if there was a way to say, suppose, all pub members of mod functions:: that implement this trait PluginFunction call register(hashmap) function. So as I add more functions as mod in functions it'll be automatically added on compile.

Pseudocode:

Files:

src/
โ”œโ”€โ”€ attrs.rs
โ”œโ”€โ”€ functions
โ”‚ย ย  โ”œโ”€โ”€ attrs.rs
โ”‚ย ย  โ”œโ”€โ”€ export.rs
โ”‚ย ย  โ””โ”€โ”€ render.rs
โ”œโ”€โ”€ functions.rs
โ”œโ”€โ”€ lib.rs

Basically, in mod functions I want:

impl AllFunctions{
    pub fn new() -> Self {
       let mut functions_map = HashMap::new();[[
       register_all!(crate::functions::* implementing PluginFunction, &mut functions_map);
       Self { function_map }
  }
}

Right now I'm doing:

impl AllFunctions{
    pub fn new() -> Self {
       let mut functions_map = HashMap::new();[[
       crate::functions::attrs::PrintAttr{}.register(&mut functions_map);
       crate::functions::export::ExportCSV{}.register(&mut functions_map);
       crate::functions::render::RenderText{}.register(&mut functions_map);
       // More as I add more functions
       Self { function_map }
  }
}
7
14
8
18
submitted 1 week ago* (last edited 1 week ago) by _hovi_@lemmy.world to c/rust@programming.dev

Hey all, just sharing a small, single-page site I built using Leptos + TailwindCSS, mainly intended as a demo for an API I built using Axum. Hope someone also finds it interesting!

I'm sharing this site and not the API itself cause I figure it's easier to look at and understand, but if you want to roast some code I would appreciate any feedback you have on the API itself (repo here). Trying to leave the front end developer scene so this is the first API I've tried building, fairly basic but it was fun (I am a big Civ V fan - I hear it's inspired by some niche thing called human history?).

Edit: whoops, looks like the link didn't get set cause I put an image - the site is available here, and the repo for it is here. The live API is available here

9
74
submitted 1 week ago by 4ffy@lemmy.ml to c/rust@programming.dev
10
31
submitted 1 week ago by kia@lemmy.ca to c/rust@programming.dev

In case you haven't seen it, here's a talk regarding Rust's integration into the Linux filesystem that gets completely derailed at The Linux Storage, Filesystem, Memory Management and BPF Summit.

11
70
Announcing Rust 1.81.0 (blog.rust-lang.org)
submitted 1 week ago by neme@lemm.ee to c/rust@programming.dev
12
27
submitted 1 week ago* (last edited 1 week ago) by fil@programming.dev to c/rust@programming.dev

After reading Drew's pitch to the rust community to write our own kernel, I've searched for "linux abi compatible rust kernel" and found "Asterinas". Surprised that it is not mentioned here

13
58
14
35
submitted 1 week ago by morrowind@lemmy.ml to c/rust@programming.dev
15
5

So I'm trying to parse school's website for some info. I'm trying to get some values using xpath. So I found a html 5 parser and it can't properly parse the first line. Then I figure you it's actually XHTML and not HTML. After quick Google search I found out XHTML can be properly parsed using any XML parser and so I found one and... It can't parse the first line. So I ask LLama3.1 (like a real programmer) why I can't parse the first line with any parser. It explained so nicely that I did not destroy my keyboard when I was told that this document is "XHTML 1.0 Transitional" and it's a mix of HTML 4 and XHTML and can't be parsed with HTML nor XML parser. I hate the guy that invented that so much...

So I can't find a crate to parse XHTML 1.0 transitional? Or a crate to convert xhtml to something else? Any advice?

16
110
17
14
18
110
19
27

Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?

20
20
submitted 3 weeks ago by daamien@lemmy.world to c/rust@programming.dev
21
50
22
5
Flashing custom FTDI board (discuss.tchncs.de)

I'd like to know if anyone has succesfully flashed a board using their own FTDI chip and not a commercial debug probe.

I want to get into using Rust and I have these STM-based boards where I put an FTDI chip on them so I get a convenient USB-port for power and debug and flashing. I'd really like to get some Rust-software running but I've just hit walls so far with flashing the boards. They work fine when using platformio/openocd and C++ but nothing has worked so far for using "cargo embed" even though it seems to find the FTDI chip correctly and start flashing but then times out.

I'd love to know if anyone has a similar setup working or can give tips on what I could try.

23
16
24
12
25
18

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

Hello again everyone, Dihar here. It's been a while since the last release of treedome, but here you go! This release is all about UI update, emojis, and bug fixes. Please consult this git diff for a more detailed changelog https://codeberg.org/solver-orgz/treedome/compare/0.4.5...0.5.0. These are the highlight of the release.

  • Add emoji picker for title, will show up in tree!
  • Text Editor toolbar is back, now with option to toggle both toolbar and floating menu independently!
  • Checkbox is here! Thanks Mantine UI!
  • You can check the size of each notes by navigating to Escape Menu -> Configure -> Show Note Sizes!
  • Add created/last modified date in notes. Note created before this will not have this field and will set as today's date!
  • Create child note can now be done through dropdown instead of only from shortcuts!
  • Fix bugs of saving empty tree
  • General UI update and more stability for auto scrolling in tree view
  • Documentation update
view more: next โ€บ

Rust

5739 readers
57 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS