From 9bd9727cb2b81e188b3f5334f35c379c0c7b4cb2 Mon Sep 17 00:00:00 2001 From: jsus Date: Sun, 19 Sep 2021 00:39:51 +0300 Subject: [PATCH] self.id fix in mutable context example --- docs/book/content/types/objects/using_contexts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/content/types/objects/using_contexts.md b/docs/book/content/types/objects/using_contexts.md index 23468926..6a096d5e 100644 --- a/docs/book/content/types/objects/using_contexts.md +++ b/docs/book/content/types/objects/using_contexts.md @@ -123,7 +123,7 @@ impl User { // If context is immutable use .read() on RwLock let mut context = context.write().await; // 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 {