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

Method collect_dependencies

crates/codegen/src/cpp.rs:137–151  ·  view source on GitHub ↗
(module: &ModuleDef, typ: &AlgebraicTypeUse)

Source from the content-addressed store, hash-verified

135 }
136
137 fn collect_dependencies(module: &ModuleDef, typ: &AlgebraicTypeUse) -> HashSet<String> {
138 let mut deps = HashSet::new();
139 match typ {
140 AlgebraicTypeUse::Array(elem_type) | AlgebraicTypeUse::Option(elem_type) => {
141 deps.extend(Self::collect_dependencies(module, elem_type));
142 }
143 AlgebraicTypeUse::Ref(type_ref) => {
144 if let Some((type_name, _)) = module.type_def_from_ref(*type_ref) {
145 deps.insert(type_name.name().to_string());
146 }
147 }
148 _ => {}
149 }
150 deps
151 }
152
153 fn collect_product_dependencies(&self, module: &ModuleDef, product: &ProductTypeDef) -> HashSet<String> {
154 let mut deps = HashSet::new();

Callers

nothing calls this directly

Calls 6

type_def_from_refMethod · 0.80
insertMethod · 0.65
nameMethod · 0.65
newFunction · 0.50
extendMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected