mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-15 09:48:53 +00:00
Merge #324
324: Fix storage examples r=nikomatsakis a=brson Co-authored-by: Brian Anderson <andersrb@gmail.com>
This commit is contained in:
commit
1a54a631d4
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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(),
|
||||
/// }
|
||||
/// )
|
||||
|
|
Loading…
Reference in a new issue