Skip to content

Commit

Permalink
chore: update readme for 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
frectonz committed Nov 15, 2024
1 parent 82324e9 commit 56cda41
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cargo add parenv

The following demonstrates a simple usage example. `parenv` relies on the `FromStr` trait to parse environment variables into the specified type.
The documentation comment on each field is used as the description for the corresponding environment variable.
To make a field optional wrap the type with an `Option`.

```rust
use std::{net::SocketAddr, path::PathBuf};
Expand All @@ -21,7 +22,7 @@ use parenv::Environment;
#[derive(Debug, Environment)]
struct Env {
/// The cat
cat: u8,
cat: Option<u8>,
/// The dog
dog: SocketAddr,
/// The file
Expand All @@ -36,4 +37,4 @@ fn main() {

## Demo

[![asciicast](https://asciinema.org/a/689713.svg)](https://asciinema.org/a/689713)
[![asciicast](https://asciinema.org/a/689791.svg)](https://asciinema.org/a/689791)

0 comments on commit 56cda41

Please sign in to comment.