Implementing the Default trait

This commit is contained in:
Nodir Turakulov 2024-01-08 18:25:30 -08:00 committed by GitHub
parent f1d318a279
commit eeac4f8d33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,14 +35,6 @@ If you want to permit accessing your database from multiple threads at once, the
{{#include ../../../examples-2022/calc/src/db.rs:par_db_impl}}
```
## Implementing the `Default` trait
It's not required, but implementing the `Default` trait is often a convenient way to let users instantiate your database:
```rust
{{#include ../../../examples-2022/calc/src/db.rs:default_impl}}
```
## Implementing the traits for each jar
The `Database` struct also needs to implement the [database traits for each jar](./jar.md#database-trait-for-the-jar).