(
name: &WorldKey,
resolve: &Resolve,
is_export: bool,
)
| 1542 | } |
| 1543 | |
| 1544 | pub(crate) fn compute_module_path( |
| 1545 | name: &WorldKey, |
| 1546 | resolve: &Resolve, |
| 1547 | is_export: bool, |
| 1548 | ) -> Vec<String> { |
| 1549 | let mut path = Vec::new(); |
| 1550 | if is_export { |
| 1551 | path.push("exports".to_string()); |
| 1552 | } |
| 1553 | match name { |
| 1554 | WorldKey::Name(name) => { |
| 1555 | path.push(to_rust_ident(name)); |
| 1556 | } |
| 1557 | WorldKey::Interface(id) => { |
| 1558 | let iface = &resolve.interfaces[*id]; |
| 1559 | let pkg = iface.package.unwrap(); |
| 1560 | let pkgname = resolve.packages[pkg].name.clone(); |
| 1561 | path.push(to_rust_ident(&pkgname.namespace)); |
| 1562 | path.push(name_package_module(resolve, pkg)); |
| 1563 | path.push(to_rust_ident(iface.name.as_ref().unwrap())); |
| 1564 | } |
| 1565 | } |
| 1566 | path |
| 1567 | } |
| 1568 | |
| 1569 | enum Identifier<'a> { |
| 1570 | World(WorldId), |
no test coverage detected