324: Fix storage examples r=nikomatsakis a=brson



Co-authored-by: Brian Anderson <andersrb@gmail.com>
This commit is contained in:
bors[bot] 2022-08-06 14:46:10 +00:00 committed by GitHub
commit 1a54a631d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,7 @@ In addition to the struct itself, we must add an impl of `salsa::Database`:
If you want to permit accessing your database from multiple threads at once, then you also need to implement the `ParallelDatabase` trait:
```rust
{{#include ../../../calc-example/calc/src/db.rs:db_impl}}
{{#include ../../../calc-example/calc/src/db.rs:par_db_impl}}
```
## Implementing the `Default` trait

View file

@ -67,7 +67,7 @@ pub trait ParallelDatabase: Database + Send {
/// fn snapshot(&self) -> Snapshot<Self> {
/// Snapshot::new(
/// MyDatabaseType {
/// runtime: self.runtime.snapshot(self),
/// runtime: self.storage.snapshot(),
/// other_field: self.other_field.clone(),
/// }
/// )