Rust

5989 readers
21 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
226
227
79
submitted 7 months ago* (last edited 7 months ago) by jwr1@kbin.earth to c/rust@programming.dev
 
 

Empowering everyone to build reliable and efficient software.

228
 
 

Hey all,

I'm going to be moving on to my next project and have been thinking about doing an email client. I like Thunderbird, but the search is terrible, and I also want to tackle something that needs pretty high performance for processing emails etc.

Any suggestions or considerations I should think about?

I'll focus on just getting SMTP going in a CLI then I'll introduce some sort of frontend using Qt.

229
 
 

Always good to read about how you can speed up compile times. I mean, sword fighting on office chairs are all fun, but still....

230
 
 

Hello,

I have a project for which some machines have only a subset of features set. Currently, I write

cargo run --no-default-features --features "toto,titi" --bin my_bin

This is a bit cumbersome and I sometimes forget the --no-default-features --features part. I was wondering if there is a local config file that I could put in the directory to instruct cargo to use this particular subset of features. I guess this should be in the documentation, but I didn't find it.

231
40
submitted 8 months ago* (last edited 8 months ago) by snaggen@programming.dev to c/rust@programming.dev
 
 

The Sovereign Tech Fund announced, in their latest news letter, that they are investing €99,060.00 in uutils coreutils which is a Rust rewrite of GNU coreutils. And here is a link to github https://github.com/uutils/coreutils

232
 
 

It is time for pre-release testing....

233
 
 

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

234
235
 
 

What do you think about the points the authors makes?

236
 
 

Kellnr 5.2.0 is released. Besides many small changes, the main feature of this release is UI support for cached crates. Until now, only private crates were shown in the UI. Now, cached crates from crates.io are shown and searchable from the UI, too.

237
238
239
 
 

Hello,

I am trying to use the SDK provided by the manufacturer of a camera from Rust. I use this in the build.rs :

println!(r"cargo:rustc-link-search=C:\Program Files\Digital Camera Toolbox\Camware4");
println!("cargo:rustc-link-lib=SC2_Cam");

However, it tries to find a .lib file, while the actual file is SC2_Cam.dll. I’ve tried specifying the kind as dylib=SC2_Cam but it makes no difference.

Am I missing something obvious, or is it just not possible? Do I have to manually load the DLL at runtime with things like the libloading crate?

240
 
 

This article shows the overview of the development process of the Fish Folly game using Fyrox Game Engine.

241
 
 

A saw this on Mastodon, and found it interesting. Rust already prevents a lot of race conditions, but deadlocks when using a mutex is still possible (and I have actually had one myself, though I caught it during testing). So, it would be nice if it would be possible to catch these cases at compile time. Now, seems to be just a proof of concept, but it is always nice to see the direction people are going and what areas are explored.

242
 
 

Removing last will break my library.

#[macro_export]
macro_rules! list {
    () => {
	None
    };
    [ $x:expr, $( $y:expr ),* ] => {
	{
	    let mut first = cons($x, &None);
	    let mut last = &mut first;
	    $(
		let yet_another = cons($y, &None);
		if let Some(ref mut last_inner) = last {
		    let last_mut = Rc::get_mut(last_inner).unwrap();
		    last_mut.cdr = yet_another;
		    last = &mut last_mut.cdr;
		}
	    )*
	    first
	}
    }
}

This macro works as I expected because it can pass these tests.

    #[test]
    fn dolist() {
        let mut v = vec![];
        dolist!((i &cons(10, &list![20, 30, 40])) {
            v.push(i.car);
        });
        assert_eq!(v, vec![10, 20, 30, 40]);
    }

    #[test]
    fn turn_list_to_vec() {
        assert_eq!(list_to_vec(&list![1, 2, 3]), vec![1, 2, 3]);
    }

    #[test]
    fn count_elements() {
        assert_eq!(list_len(&list![10, 20, 30]), 3);
    }

However I got the warning "value assigned to last is never read."

How can I avoid this warning?

P.S. Full code

243
244
245
 
 

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

246
247
248
249
250
view more: ‹ prev next ›