Hacker News new | past | comments | ask | show | jobs | submit login

I'm new to Rust, can someone tell me if that's good Rust code I could learn from?

https://github.com/achristmascarl/rainfrog/blob/main/src/app...




I only looked at the linked file, so I'm not going to speak to the rest of the code and don't really have a good grasp of the architecture here.

This seems mostly ok. The only thing that (imo) wouldn't pass code review is that big honking loop at https://github.com/achristmascarl/rainfrog/blob/main/src/app.... That thing needs to be refactored down to be readable, with individual logic chunks being put into their own functions and tidied up a bit.

That's not really Rust-specific, obviously, but all the `match` and `if let` and whatever other Rust stuff looks fine, so it's what I've got.


nope :)


on a more serious note, the library i used for the query editor, tui-textarea [0], is very well done, and the other db tui i drew inspiration from, gobang[1], is a great example of a ratatui app. would recommend checking those out

[0] https://github.com/rhysd/tui-textarea

[1] https://github.com/TaKO8Ki/gobang


Looks great! I'll be watching your progress with great interest.

What do you use for the DataTable widget? Is there a Rust/Ratatui equivalent of DataTable (https://textual.textualize.io/widgets/data_table/) used by Harlequin?



(People downvoting this: that's the author.)




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: