MCPcopy Create free account
hub / github.com/astral-sh/ruff / take_thin_vec

Method take_thin_vec

crates/ruff_python_parser/src/parser/scratch_buffer.rs:51–61  ·  view source on GitHub ↗
(&mut self, mut snapshot: ScratchSnapshot)

Source from the content-addressed store, hash-verified

49
50 #[inline]
51 pub(super) fn take_thin_vec(&mut self, mut snapshot: ScratchSnapshot) -> ThinVec<T> {
52 if self.is_empty(&snapshot) {
53 snapshot.bomb.defuse();
54 return ThinVec::new();
55 }
56
57 let drain = self.drain_snapshot(snapshot);
58 let mut result = ThinVec::with_capacity(drain.len());
59 result.extend(drain);
60 result
61 }
62
63 #[inline]
64 fn drain_snapshot(&mut self, mut snapshot: ScratchSnapshot) -> Drain<'_, T> {

Callers 4

parse_argumentsMethod · 0.80
parse_blockMethod · 0.80
parse_parametersMethod · 0.80

Calls 5

drain_snapshotMethod · 0.80
is_emptyMethod · 0.45
defuseMethod · 0.45
lenMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected