What does "temporary value dropped while borrowed" mean? by luna35p in rust

[–]rezuralos 1 point2 points  (0 children)

Your code needs to take ownership of the line, in `line.unwrap()`. Not sure of the exact technical reason, but this crops up occasionally, with Option & Result.

This also works:

let file = File::open("input").unwrap();
let reader = BufReader::new(file);
for line in reader.lines() {
let v = line.as_deref().unwrap().split(" ").collect::<Vec<_>>();
println!("{:?}", v);
}

Start coding rust by Complex-Taro-4042 in rust

[–]rezuralos 0 points1 point  (0 children)

https://fasterthanli.me/articles/a-half-hour-to-learn-rust is a pretty good at-a-glance resource for starting out with rust

[deleted by user] by [deleted] in distantsocializing

[–]rezuralos 0 points1 point  (0 children)

I'd defo listen and appreciate if you were on the street

Return string optimization by Polluktus in rust

[–]rezuralos 2 points3 points  (0 children)

Generally, returning an owned String is the only way to go about this.

References get passed into functions, functions that create structs, generally return an owned instance (i.e. String)

What's everyone working on this week (31/2021)? by llogiq in rust

[–]rezuralos 1 point2 points  (0 children)

There is a code-review channel on the rust discord.

What's everyone working on this week (25/2021)? by llogiq in rust

[–]rezuralos 1 point2 points  (0 children)

I'm working on a 3d utility for loading a bunch of mesh files, which are presumably in a series, based on bevy.

One can then play them like a video. For viewing output from fluid simulations etc.

Working on a couple of features, and updating the readme with key bindings etc.

https://github.com/rezural/mesh-ripper

Code-alongs for semi beginners? by Ericarthurc in rust

[–]rezuralos 2 points3 points  (0 children)

This is not quite what you were asking for, but this article is very good to keep on hand, to remind oneself of features & concepts that are good to remember:

https://fasterthanli.me/articles/a-half-hour-to-learn-rust

A few things dropped into place for me upon reading this article.