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

Method join

crates/wtf8/src/lib.rs:333–349  ·  view source on GitHub ↗
(sep: impl AsRef<Wtf8>, iter: I)

Source from the content-addressed store, hash-verified

331 }
332
333 pub fn join<I, S>(sep: impl AsRef<Wtf8>, iter: I) -> Wtf8Buf
334 where
335 I: IntoIterator<Item = S>,
336 S: AsRef<Wtf8>,
337 {
338 let sep = sep.as_ref();
339 let mut iter = iter.into_iter();
340 let mut buf = match iter.next() {
341 Some(first) => first.as_ref().to_owned(),
342 None => return Wtf8Buf::new(),
343 };
344 for part in iter {
345 buf.push_wtf8(sep);
346 buf.push_wtf8(part.as_ref());
347 }
348 buf
349 }
350
351 pub fn clear(&mut self) {
352 self.bytes.clear();

Callers 9

parse_requirementFunction · 0.45
decompositionMethod · 0.45
nextMethod · 0.45
keyMethod · 0.45
func_sigFunction · 0.45
compileMethod · 0.45
compile_singleMethod · 0.45
compile_dirMethod · 0.45

Calls 6

newFunction · 0.85
push_wtf8Method · 0.80
as_refMethod · 0.45
into_iterMethod · 0.45
nextMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected