Rust Pro Tips (collection)

3 years ago by hatchet to c/rust

Level up your Rust skills.

Whenever I encounter an interesting Rust programming technique, I add it to this blog post. I've amassed a bit of a collection. Hopefully someone finds it interesting and useful!

load all comments
pgsuper 0 points 3 years ago

Nice job! I’d add that the target of the Rustdoc link shortcuts can be customized, in case they are not autodetected or point to an undesired location, like so:

/// Use a [Tool]
///
/// [Tool]: lib::types::Tool

That will make the word Tool point to that type (note that the namespaces there - in lib::types::Tool - are relative to the current module / context, so you can use an imported name directly there too, for example).

path: 0 1763900, hotness: undefined, score: 0, children: 0
rust
rust

@lemmy.ml

login for more options
9404
398
101

go to feed...