From ea2e369628d9793b7509a3d5729aeb1cf92cfea6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 31 Jul 2020 23:02:08 +0100 Subject: [PATCH] explain why PlayerUpdate interface --- src/updates.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/updates.rs b/src/updates.rs index 9246a714..86dc5441 100644 --- a/src/updates.rs +++ b/src/updates.rs @@ -98,6 +98,8 @@ impl PlayerUpdates { self.log.push_back(update.into()); self.cv.notify_all(); } + // giving out only immutable references means no-one can + // forget to cv.notify pub fn read_log(&self) -> &PlayerUpdatesLog { &self.log } pub fn get_cv(&self) -> Arc { self.cv.clone() } } -- 2.30.2