Skip to content

Instantly share code, notes, and snippets.

View smokes's full-sized avatar
🔷

Smokie smokes

🔷
View GitHub Profile
@parmentf
parmentf / GitCommitEmoji.md
Last active May 9, 2024 13:47
Git Commit message Emoji
@jvns
jvns / rust-types.md
Last active October 5, 2021 08:41
Rust type tutorial

I found understanding Rust types really confusing, so I wrote up a small tutorial for myself in an attempt to understand some of them. This is by no means exhaustive. There is a types section in the manual, but it has nowhere near enough examples.

I'm not talking about managed pointers (@) at all. A lot of the difficulty with Rust types is that the language is constantly changing, so this will likely be out of date soon.

First, a few preliminaries: it's easier to play with types if you have a REPL and can interactively check the types of objects. This isn't really possible in Rust, but there are workarounds.

To start out: some help

How to get a Rust REPL