Skip to content

Commit 15700ec

Browse files
committed
rpt 33 tweet & toot links
1 parent 88a38ec commit 15700ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/blog/rust-pro-tips-collection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This is a collection of Rust "pro tips" that I've collected, most of which have
1414

1515
## 33. Use tuple struct initializers as function pointers
1616

17-
<!-- [Tweet]() [Toot]() -->
17+
[Tweet](https://twitter.com/sudo_build/status/1751597656114446377) [Toot](https://infosec.exchange/@hatchet/111833792212244273)
1818

1919
Tuple struct initializers can be cast to function pointers. This can help to avoid creating unnecessary lambda functions, e.g. when calling [`Iterator::map`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.map).
2020

@@ -29,8 +29,8 @@ fn zeroes<T>(f: fn(i32, i32) -> T) -> T {
2929
assert_eq!(zeroes(Point), Point(0, 0));
3030
```
3131

32-
[Docs](https://doc.rust-lang.org/reference/expressions/struct-expr.html#tuple-struct-expression) \
33-
[Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7cb12bc6930a9ae03204a33eb50529ce)
32+
[Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7cb12bc6930a9ae03204a33eb50529ce) \
33+
[Docs](https://doc.rust-lang.org/reference/expressions/struct-expr.html#tuple-struct-expression)
3434

3535
## 32. Absolute import paths
3636

0 commit comments

Comments
 (0)