MCPcopy Index your code
hub / github.com/RustPython/RustPython / map_utf8

Method map_utf8

crates/wtf8/src/lib.rs:919–927  ·  view source on GitHub ↗
(&'a self, f: impl Fn(&'a str) -> I)

Source from the content-addressed store, hash-verified

917 }
918
919 pub fn map_utf8<'a, I>(&'a self, f: impl Fn(&'a str) -> I) -> impl Iterator<Item = CodePoint>
920 where
921 I: Iterator<Item = char>,
922 {
923 self.chunks().flat_map(move |chunk| match chunk {
924 Wtf8Chunk::Utf8(s) => Either::Left(f(s).map_into()),
925 Wtf8Chunk::Surrogate(c) => Either::Right(core::iter::once(c)),
926 })
927 }
928
929 #[inline]
930 fn next_surrogate(&self, mut pos: usize) -> Option<(usize, u16)> {

Callers 2

normalizeMethod · 0.80
is_normalizedMethod · 0.80

Calls 5

onceFunction · 0.85
LeftClass · 0.50
fFunction · 0.50
RightClass · 0.50
chunksMethod · 0.45

Tested by

no test coverage detected