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

Method pop

crates/common/src/boxvec.rs:134–143  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

132 }
133
134 pub fn pop(&mut self) -> Option<T> {
135 if self.is_empty() {
136 return None;
137 }
138 unsafe {
139 let new_len = self.len() - 1;
140 self.set_len(new_len);
141 Some(ptr::read(self.get_unchecked_ptr(new_len)))
142 }
143 }
144
145 pub fn swap_remove(&mut self, index: usize) -> T {
146 self.swap_pop(index)

Callers 15

find_unclosed_bracketFunction · 0.45
swap_popMethod · 0.45
clone_fromMethod · 0.45
with_appendMethod · 0.45
finishMethod · 0.45
leave_scopeMethod · 0.45
pop_symbol_tableMethod · 0.45
exit_scopeMethod · 0.45
exit_annotation_scopeMethod · 0.45
pop_fblockMethod · 0.45

Calls 6

set_lenMethod · 0.80
get_unchecked_ptrMethod · 0.80
readFunction · 0.70
SomeClass · 0.50
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected