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

Method chain

crates/stdlib/src/compression.rs:85–94  ·  view source on GitHub ↗
(data1: &'a [u8], data2: &'a [u8])

Source from the content-addressed store, hash-verified

83 }
84 }
85 pub const fn chain(data1: &'a [u8], data2: &'a [u8]) -> Self {
86 if data1.is_empty() {
87 Self {
88 data1: data2,
89 data2: &[],
90 }
91 } else {
92 Self { data1, data2 }
93 }
94 }
95 pub const fn len(&self) -> usize {
96 self.data1.len() + self.data2.len()
97 }

Callers 15

_signature_fromstrFunction · 0.80
_bindMethod · 0.80
_flattenMethod · 0.80
_create_slotsFunction · 0.80
iglobFunction · 0.80
compatMethod · 0.80
tokenizeFunction · 0.80
__iter__Method · 0.80
__init__Method · 0.80
__iter__Method · 0.80
__delitem__Method · 0.80

Calls 1

is_emptyMethod · 0.45

Tested by 3

test_content_length_0Method · 0.64