Educational Rust live coding - Building a git CLI

preview_player
Показать описание
In this live coding stream we build a small CLI to delete old git branches. We do it using Rust and I try to explain everything as we go along.

Topics include:
- Error handling, without using unwrap/expect
- Fixing common ownership issues
- Finding your way around a large third party library
- Lots of other misc Rust tips and tricks

Рекомендации по теме
Комментарии
Автор

The demonstration of thiserror was great!

jRsqILVOY
Автор

Fantastic stream. You’re a great educator! I hope you get the time for more of those!

dim-d
Автор

This is wonderfully helpful and I’m only an hour in. Thank you!

zeusdeux
Автор

1:06:00 The way you explained the string. I am your fan now. Will love to watch a more real-world stream rust use case scenario. How about stream on FFI, take python for an instance using rust binary to handle excel sheet parsing or what not! It will definitely help clear up the concept of using rust properly. or Embedded, SoC use case stuff as well.


What made me stop the recorded stream in between and come here comment was, the way you are taking everyone's query between stream, and on the basis of importance you take enough time to clear the doubt of the viewer. That was just heartfelt. Keep doing this.
PS:- I read 10 chapters of the rust book it definitely helped to get familiar with the basic concepts.

Dishankjindal
Автор

39:10 Actually stdin can and will run out of input when it is closed and/or reads EOF (end-of-file). This can happen for example when the input is piped into the program or if you press Ctrl-D on the terminal (which will send EOF). If you unwrap on the iterator this will cause a panic. I use Ctrl-D all the time to exit interactive CLI tools.

There is also another use for Ctrl-D in non-raw mode: If you enter some text before pressing Ctrl-D it will not send EOF but instead flush the terminal buffer and pass the entered text to the application similar to entering a newline (but without the newline character at the end).

vader
Автор

I wish you had more time, your coding sessions are great

romanstingler
Автор

3:13:09 I think you could use a label there on the for loop to continue to the label like a goto...like 'outer: for... continue 'outer

MonkeeSage
Автор

Thank you so much for doing this kinda videos, this is super helpful!

DavidLopez-tfbn
Автор

Thank you for the stream ! Learnt a ton !

shashanksharma
Автор

Great stream. Definitely learned some good tricks.
At 2:28:24 I think you could have actually used filter_map, but you were returning Result<Option<T>, E> whereas filter_map should output Option<T>, so by returning Option<Result<T, E>> I think it would have compiled.
Also if you delete the last branch in the loop you don't get a chance to undo with your current implementation, do you?

Again thanks for a great stream from a fellow Dane :)

lauh
Автор

Rust: has 2 types for strings.
Same time C++: const char*, std::string, std::string_view

misana
Автор

The reason you couldn’t delete master is that it was the branch you currently had checked out. The right thing to do there was to check whether the branch equaled repo.head().

MrTact
Автор

Thanks for the tutorial! I'm also curious about your setup...what are you using to run rust-analyzer? I use coc.nvim but it doesn't look quite the same. Also, are you using tmux? I like your statusbar.

comfortablynick
Автор

Great video - it was very informative.
With using recursion on the act_on_branch, would someone continuously using 'undo' eventually blow the stack ?

MK-fdgz
Автор

Hi, nice video! What would be the best way to list all branches as a list menu so the user can select specific branch with the arrow keys, any library recommendation?

ognyangenev
Автор

How do you get those warnings/errors inline? I am using nvim and coc but I cant seem to find an option to do that...

shashanksharma
Автор

Also what are your text editor settings? It looks like gvim - but you have rust-analyzer errors in line and comment/uncomment blocks at a time?

jRsqILVOY
Автор

"sudo apt install libssl-dev" You're welcome;)

bogdanfarafonov