From af03bfbb31b041ae68837e232b79ab95598240a5 Mon Sep 17 00:00:00 2001 From: Hugo Caillard <911307+hugocaillard@users.noreply.github.com> Date: Thu, 22 Dec 2022 19:03:28 +0100 Subject: [PATCH] docs: fix index-of api reference --- clarity/src/vm/docs/mod.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/clarity/src/vm/docs/mod.rs b/clarity/src/vm/docs/mod.rs index ef4d059ea..f19aa2012 100644 --- a/clarity/src/vm/docs/mod.rs +++ b/clarity/src/vm/docs/mod.rs @@ -1134,10 +1134,10 @@ In Clarity1, `element-at` must be used (without the `?`). The `?` is added in Cl const INDEX_OF_API: SpecialAPI = SpecialAPI { input_type: "sequence_A, A", - snippet: "index-of ${1:sequence} ${2:item}", + snippet: "index-of? ${1:sequence} ${2:item}", output_type: "(optional uint)", - signature: "(index-of sequence item)", - description: "The `index-of` function returns the first index at which `item` can be + signature: "(index-of? sequence item)", + description: "The `index-of?` function returns the first index at which `item` can be found, using `is-eq` checks, in the provided sequence. Applicable sequence types are `(list A)`, `buff`, `string-ascii` and `string-utf8`, for which the corresponding element types are, respectively, `A`, `(buff 1)`, `(string-ascii 1)` and `(string-utf8 1)`. @@ -1146,11 +1146,11 @@ supplied), this function returns `none`. In Clarity1, `index-of` must be used (without the `?`). The `?` is added in Clarity2 for consistency -- built-ins that return responses or optionals end in `?`. The Clarity1 spelling is left as an alias in Clarity2 for backwards compatibility. ", example: r#" -(index-of "blockstack" "b") ;; Returns (some u0) -(index-of "blockstack" "k") ;; Returns (some u4) -(index-of "blockstack" "") ;; Returns none -(index-of (list 1 2 3 4 5) 6) ;; Returns none -(index-of 0xfb01 0x01) ;; Returns (some u1) +(index-of? "blockstack" "b") ;; Returns (some u0) +(index-of? "blockstack" "k") ;; Returns (some u4) +(index-of? "blockstack" "") ;; Returns none +(index-of? (list 1 2 3 4 5) 6) ;; Returns none +(index-of? 0xfb01 0x01) ;; Returns (some u1) "#, };