Implementing Config Files for your Rust CLI tool | Rustlang Lets Code!

preview_player
Показать описание
Follow along as we implement Toml config files for our Rust CLI tool, taking care to place configuration in the OS-preferred directories on each platform.

## Crates used in this project:

## Chapters

00:00 Intro
01:17 The directories crate
05:04 Config files as Toml with Serde
06:47 Enabling the derive macro for Deserialize using Cargo features
12:23 Using the docs to find what errors are defined in the source code
Рекомендации по теме
Комментарии
Автор

Look into unwrap or default and implement the default trait, it cleans up the clutter from where you call unwrap_or

kaktoffel
Автор

Thanks, very useful tutorial! Can you make another video explaining the stuff mentioned at the end of the video? That would help a lot

nzdn
Автор

How do you implement merging of config files based on a hierarchy?

Example: workspace config can override user config, missing keys can be taken from default config, etc?

SharunKumar