| CodeBerg | https://codeberg.org/atamakahere |
| GitHub | https://github.com/atamakahere-git |
Super useful diagram that explains all available transformations between Result and Option standard #Rust types and their interactions.
Source: https://docs.google.com/drawings/d/1EOPs0YTONo_FygWbuJGPfikO9Myt5HwtiFUHRuE1JVM/edit
Result<T, E> Result<U, E> Result<T, F> Option<T> T E Option<E> unwrap, expect, unwrap_or[_else], unwrap_or_default () unwrap_err, expect_err Err(e) Ok(t) Some(t) ok_or[_else] ok err map, and[_then] map_err None or[_else] Option<U> map, and[_then] U map_or [_else] filter, xor, or[_else], replace
@sanchayan
> I don't understand how folks are productive in languages without strong static types. I envy you.
+1 on that
Unpopular opinion but #rust for rustaceans is not written in a way to make it easier to understand .
It lacks visual aids like graphs, tables, figures that would make it easier to understand. Some sentences goes beyond the scope of reader and is not emphasised on. It is a great book of knowledge but I think it can be made simpler to understand and read, reducing the friction will help more devs to become better at rust.
I have already read and understood the concepts from the book.
I’m reading the “Linux Systems Programming” book by Robert Love, while reading the 2nd chapter, File I/O and learning about open, read and write syscall. I implemented these programs as an exercise for myself
1. Example program to use open syscall
2. /etc/passwd file parser, using open read syscall
3. cp cmd using open read and write
I have spent more than 6hrs on the 2nd one because the read syscall fills the buffer and I have to read it line by line, later I used read to get single char.