MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / ensure_model

Function ensure_model

tools/xtask-llm-benchmark/src/bench/normalize.rs:54–64  ·  view source on GitHub ↗
(mode_v: &'a mut ModeEntry, name: &str)

Source from the content-addressed store, hash-verified

52}
53
54pub fn ensure_model<'a>(mode_v: &'a mut ModeEntry, name: &str) -> &'a mut ModelEntry {
55 if let Some(i) = mode_v.models.iter().position(|m| m.name == name) {
56 return &mut mode_v.models[i];
57 }
58 mode_v.models.push(ModelEntry {
59 name: name.to_string(),
60 route_api_model: None,
61 tasks: Default::default(),
62 });
63 mode_v.models.last_mut().unwrap()
64}
65
66/// Normalize mode aliases to their canonical names before saving.
67pub fn canonical_mode(mode: &str) -> &str {

Callers 1

upload_batchMethod · 0.85

Calls 5

positionMethod · 0.80
iterMethod · 0.65
pushMethod · 0.45
to_stringMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…