Complete these tasks to reinforce what you learned in this module.
Define a struct AppConfig with a field name: String. Parse a TOML string (e.g. name = \"myapp\") with toml::from_str and print the name. Handle the Result (e.g. with expect or ? in a function that returns Result).
name field and derive Deserialize. Use toml::from_str on a TOML string that defines name; handle the Result.// Task 1: Load TOML config. See tasks/TASKS.md.
fn main() {
todo!("Parse TOML into AppConfig, print name");
}
Call dotenvy::dotenv().ok() at startup, then read an environment variable (e.g. APP_NAME or MESSAGE) with std::env::var. If set, print it; if not set, print a default (e.g. "default"). Create a .env file with one variable to test, or pass it when running: APP_NAME=test cargo run ....
.env at startup, then read the variable with std::env::var. If the variable is missing, use a default value (e.g. with unwrap_or_else).// Task 2: Load .env and read variable. See tasks/TASKS.md.
fn main() {
todo!("dotenvy::dotenv(); read APP_NAME, print or default");
}