From a816da60628a988305ea057c8b1833f94a5dcdad Mon Sep 17 00:00:00 2001 From: Adrien Burgun Date: Wed, 6 Jul 2022 18:40:41 +0200 Subject: [PATCH] :arrow_up: Upgrade veccell --- stackline/Cargo.toml | 2 +- stackline/src/context.rs | 2 -- stackline/src/pane.rs | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/stackline/Cargo.toml b/stackline/Cargo.toml index f39f60e..c0c4f6e 100755 --- a/stackline/Cargo.toml +++ b/stackline/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" palette = "0.6" enum_dispatch = "0.3" contracts = { version = "0.6.3", features = ["override_debug"] } -veccell = "0.1" +veccell = "0.2" [dev-dependencies] colored = "2.0" diff --git a/stackline/src/context.rs b/stackline/src/context.rs index 1630c08..3c91891 100644 --- a/stackline/src/context.rs +++ b/stackline/src/context.rs @@ -1,8 +1,6 @@ use super::*; use veccell::{VecRef, VecRefMut}; -// TODO: write VecCell, to make miri happy - /** Provides an interface between a [`Tile`] and its parent [`Pane`] during [`Tile::update`]. All actions performed through `UpdateContext` will be executed *after* all the tiles have updated. diff --git a/stackline/src/pane.rs b/stackline/src/pane.rs index ca04b0b..e6d0d63 100644 --- a/stackline/src/pane.rs +++ b/stackline/src/pane.rs @@ -149,7 +149,7 @@ impl Pane { return None; } - self.tiles.get(position.1 * self.width.get() + position.0) + self.tiles.borrow(position.1 * self.width.get() + position.0) } /// Returns a mutable reference to the [`Tile`] at `position`.