From 6111dc921fca0ece34f7154581ece1e09500da34 Mon Sep 17 00:00:00 2001 From: GrayJack Date: Wed, 27 Nov 2024 03:03:15 -0300 Subject: [PATCH] doc: Fix examples --- src/types/array.rs | 2 +- src/types/tuple.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/array.rs b/src/types/array.rs index df0b10e3ce..fcb14d6917 100644 --- a/src/types/array.rs +++ b/src/types/array.rs @@ -1453,7 +1453,7 @@ impl<'data> JanetArray<'data> { /// let mut s = array![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]; /// let num = Janet::from(42); /// let idx = s.binary_search(&num).unwrap_or_else(|x| x); - /// s.insert(idx as i32, num); + /// s.insert(idx, num); /// assert_eq!( /// s.as_ref(), /// array![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55].as_ref() diff --git a/src/types/tuple.rs b/src/types/tuple.rs index 1d6375f4c7..9af15b81be 100644 --- a/src/types/tuple.rs +++ b/src/types/tuple.rs @@ -528,7 +528,7 @@ impl<'data> JanetTuple<'data> { /// let num = Janet::from(42); /// let idx = s.binary_search(&num).unwrap_or_else(|x| x); /// let mut s = JanetArray::from(s); - /// s.insert(idx as i32, num); + /// s.insert(idx, num); /// assert_eq!( /// s.as_ref(), /// tuple![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55].as_ref()