Merge branch 'main' into randomized-tests-operation-script

This commit is contained in:
Max Brunsfeld 2023-04-03 13:09:25 -07:00
commit c960277349
483 changed files with 32884 additions and 10315 deletions

View file

@ -22,7 +22,7 @@ digest = { version = "0.9", features = ["std"] }
lazy_static = "1.4"
log = { version = "0.4.16", features = ["kv_unstable_serde"] }
parking_lot = "0.11"
postage = { version = "0.4.1", features = ["futures-traits"] }
postage = { workspace = true }
rand = { version = "0.8.3", optional = true }
smallvec = { version = "1.6", features = ["union"] }
util = { path = "../util" }

View file

@ -1591,6 +1591,14 @@ impl BufferSnapshot {
self.text_for_range(range).flat_map(str::chars)
}
pub fn reversed_chars_for_range<T: ToOffset>(
&self,
range: Range<T>,
) -> impl Iterator<Item = char> + '_ {
self.reversed_chunks_in_range(range)
.flat_map(|chunk| chunk.chars().rev())
}
pub fn contains_str_at<T>(&self, position: T, needle: &str) -> bool
where
T: ToOffset,