(&self)
| 404 | } |
| 405 | |
| 406 | pub(crate) fn path_to_root(&self) -> String { |
| 407 | let mut path_to_root = String::new(); |
| 408 | |
| 409 | match self.identifier { |
| 410 | Identifier::Interface(_, key) => { |
| 411 | // Escape the submodule for this interface |
| 412 | path_to_root.push_str("super::"); |
| 413 | |
| 414 | // Escape the `exports` top-level submodule |
| 415 | if !self.in_import { |
| 416 | path_to_root.push_str("super::"); |
| 417 | } |
| 418 | |
| 419 | // Escape the namespace/package submodules for interface-based ids |
| 420 | match key { |
| 421 | WorldKey::Name(_) => {} |
| 422 | WorldKey::Interface(_) => { |
| 423 | path_to_root.push_str("super::super::"); |
| 424 | } |
| 425 | } |
| 426 | } |
| 427 | Identifier::StreamOrFuturePayload => path_to_root.push_str("super::super::"), |
| 428 | _ => {} |
| 429 | } |
| 430 | path_to_root |
| 431 | } |
| 432 | |
| 433 | pub fn start_append_submodule(&mut self, name: &WorldKey) -> (String, Vec<String>) { |
| 434 | let snake = match name { |
no test coverage detected