MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / insert

Method insert

src/prof/src/lib.rs:243–251  ·  view source on GitHub ↗
(&mut self, s: &str)

Source from the content-addressed store, hash-verified

241 }
242
243 fn insert(&mut self, s: &str) -> i64 {
244 if let Some(idx) = self.0.get(s) {
245 *idx
246 } else {
247 let idx = i64::try_from(self.0.len()).expect("must fit");
248 self.0.insert(s.into(), idx);
249 idx
250 }
251 }
252
253 fn finish(self) -> Vec<String> {
254 let mut vec: Vec<_> = self.0.into_iter().collect();

Callers 1

to_pprofMethod · 0.45

Calls 3

expectMethod · 0.80
getMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected