From d0f40530ff673f9a10bdfb9c3bf6d1c0bae8533d Mon Sep 17 00:00:00 2001 From: Francesco Magliocca Date: Mon, 9 Nov 2020 21:07:37 +0100 Subject: [PATCH] Document the update detection mechanism of VersionedCanvas::update --- src/versioned_canvas.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/versioned_canvas.rs b/src/versioned_canvas.rs index 546f766..fc96ed8 100644 --- a/src/versioned_canvas.rs +++ b/src/versioned_canvas.rs @@ -45,6 +45,10 @@ impl VersionedCanvas { } } + // TODO: Right now the update function internally checks + // whether the canvas has been changed by leveraging the + // Copy on Write semantics of im::Vector. + // Is this a good solution? Does this work correctly? THINK ABOUT THIS pub fn update(&mut self, update_fn: impl FnOnce(&mut Canvas)) { // This is a linear history, // so we first check if there are newer versions, if so