MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / size_hint

Method size_hint

atomic-core/src/diff/split.rs:256–264  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

254 }
255
256 fn size_hint(&self) -> (usize, Option<usize>) {
257 if self.finished {
258 (0, Some(0))
259 } else {
260 // At least 1 item, at most content.len() / separator.len() + 1
261 let max_lines = self.content.len() / self.separator.len().max(1) + 1;
262 (1, Some(max_lines))
263 }
264 }
265}
266
267/// Split content into lines using the default newline separator.

Callers 1

test_linesplit_size_hintFunction · 0.45

Calls 1

lenMethod · 0.45

Tested by 1

test_linesplit_size_hintFunction · 0.36