-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
episode.yml
26 lines (26 loc) · 1.42 KB
/
episode.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
number: 2
title: Snakes and Gears
id: bS5rtxWd2yQ
intro: >
Let's talk about Python and Rust. I used to do a lot more Python than I do now, but I still love it for its beauty.
details: >
One of the first things I was missing in Rust when coming from Python were List Comprehensions.
It took me a while to figure out, that the Rust way - using iter(), filter(), and map() - actually is a better fit for the language.
I want to show you how to port Rust list comprehensions to Rust.
keywords:
- iterators
- map
- filter
- Entry API
- List comprehensions
notes:
- Reading files using the [Rust Cookbook](https://rust-lang-nursery.github.io/rust-cookbook/file/read-write.html#read-lines-of-strings-from-a-file).
- "[DevDocs](http://devdocs.io/) is a nice Rust documentation viewer. Also supports a ton of other languages and works offline."
others:
- "[Iteration patterns for Result & Option](http://xion.io/post/code/rust-iter-patterns.html)"
- Experimenting with Python is much cooler with [Jupyter](http://jupyter.org/) (or IPython) notebooks. I've added an example to the code section.
- If you really **need** list comprehensions, you could use [cute](https://crates.io/crates/cute), which is a set of macros that make this syntax possible.
metas:
- "Colorscheme: [Gruvbox Dark](https://github.com/morhetz/gruvbox)"
licenses:
- "Intro song: Aries Beats - Night Ride (https://www.youtube.com/watch?v=AOvr_57BMZo)"