(
&mut self,
resolve: &Resolve,
id: InterfaceId,
name: &WorldKey,
interface_kind: InterfaceKind,
)
| 256 | } |
| 257 | |
| 258 | fn generate_interface_name( |
| 259 | &mut self, |
| 260 | resolve: &Resolve, |
| 261 | id: InterfaceId, |
| 262 | name: &WorldKey, |
| 263 | interface_kind: InterfaceKind, |
| 264 | ) -> Vec<String> { |
| 265 | let mut path = Vec::new(); |
| 266 | match interface_kind { |
| 267 | InterfaceKind::Import => {} |
| 268 | InterfaceKind::Export => path.push("exports".to_string()), |
| 269 | InterfaceKind::Named => path.push("named_imports".to_string()), |
| 270 | } |
| 271 | match name { |
| 272 | WorldKey::Name(name) => { |
| 273 | path.push(name.to_snake_case()); |
| 274 | } |
| 275 | WorldKey::Interface(_) => { |
| 276 | let iface = &resolve.interfaces[id]; |
| 277 | let pkgname = &resolve.packages[iface.package.unwrap()].name; |
| 278 | path.push(pkgname.namespace.to_snake_case()); |
| 279 | path.push(self.name_package_module(resolve, iface.package.unwrap())); |
| 280 | path.push(to_rust_ident(iface.name.as_ref().unwrap())); |
| 281 | } |
| 282 | } |
| 283 | path |
| 284 | } |
| 285 | |
| 286 | fn name_interface( |
| 287 | &mut self, |
no test coverage detected