MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / parse_wit

Function parse_wit

crates/test-helpers/src/lib.rs:143–151  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

141}
142
143fn parse_wit(path: &Path) -> (Resolve, WorldId) {
144 let mut resolve = Resolve::default();
145 let (pkg, _files) = resolve.push_path(path).unwrap();
146 let world = resolve.select_world(&[pkg], None).unwrap_or_else(|_| {
147 // note: if there are multiples worlds in the wit package, we assume the "imports" world
148 resolve.select_world(&[pkg], Some("imports")).unwrap()
149 });
150 (resolve, world)
151}

Callers 2

run_world_codegen_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected