add instructions to include sled and xdg dependencies

This commit is contained in:
glyph 2022-10-02 17:17:00 +01:00
parent 59947f6166
commit 3946f2f7dc
1 changed files with 8 additions and 1 deletions

View File

@ -62,7 +62,14 @@ impl Database {
}
```
The initialisation method requires a `Path` in order to open / create the database. We can use the [xdg](https://crates.io/crates/xdg) crate to generate a path using the XDG Base Directory specification. Open `src/main.rs` and add the following code:
The initialisation method requires a `Path` in order to open / create the database. We can use the [xdg](https://crates.io/crates/xdg) crate to generate a path using the XDG Base Directory specification. Add the dependencies for `sled` and `xdg` to `Cargo.toml`:
```toml
sled = "0.34"
xdg = "2.4.1"
```
Now open `src/main.rs` and add the following code:
```rust
mod db;