self.id fix in mutable context example
This commit is contained in:
parent
8d27055561
commit
9bd9727cb2
1 changed files with 1 additions and 1 deletions
|
@ -123,7 +123,7 @@ impl User {
|
||||||
// If context is immutable use .read() on RwLock
|
// If context is immutable use .read() on RwLock
|
||||||
let mut context = context.write().await;
|
let mut context = context.write().await;
|
||||||
// Preform a mutable operation
|
// Preform a mutable operation
|
||||||
context.requested_count.entry(0).and_modify(|e| { *e += 1 }).or_insert(1)
|
context.requested_count.entry(self.id).and_modify(|e| { *e += 1 }).or_insert(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn name(&self) -> &str {
|
fn name(&self) -> &str {
|
||||||
|
|
Loading…
Reference in a new issue