From 78199507902889b223934c20e7d05946f632dd3b Mon Sep 17 00:00:00 2001 From: Andrew Dirksen Date: Wed, 21 Nov 2018 18:24:01 -0800 Subject: [PATCH] fix doctest --- src/common/stack.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/stack.rs b/src/common/stack.rs index 0c4743a..501da64 100644 --- a/src/common/stack.rs +++ b/src/common/stack.rs @@ -130,10 +130,10 @@ impl StackWithLimit { /// ``` /// # extern crate wasmi; /// # use wasmi::{StackWithLimit, StackSize}; - /// let bstack = StackWithLimit::::with_size(StackSize::from_element_count(2)); + /// let mut bstack = StackWithLimit::::with_size(StackSize::from_element_count(2)); /// bstack.push(4); - /// assert_eq!(bstack.nth_from_top(0, Some(&4)); - /// assert_eq!(bstack.nth_from_top(1, None); + /// assert_eq!(bstack.nth_from_top(0), Some(&4)); + /// assert_eq!(bstack.nth_from_top(1), None); /// ``` pub fn nth_from_top(&self, depth: usize) -> Option<&T> { // Be cognizant of integer underflow and overflow here. Both are possible in this situation.