From 7284301ce8e1ce87aa194c78258af93067f14c60 Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Sat, 22 Oct 2022 23:01:55 +0800 Subject: [PATCH] doc: add sliceable doc --- crates/rle/src/rle_trait.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/rle/src/rle_trait.rs b/crates/rle/src/rle_trait.rs index 3e07d6e5..ec005c42 100644 --- a/crates/rle/src/rle_trait.rs +++ b/crates/rle/src/rle_trait.rs @@ -19,6 +19,9 @@ pub trait Mergable { } } +/// NOTE: [Sliceable] implementation should be coherent with [Mergable]: +/// +/// - For all k, a.slice(0,k).merge(a.slice(k, a.len())) == a pub trait Sliceable { fn slice(&self, from: usize, to: usize) -> Self; }