Add an alias to the root manifest; additive, accumulates across calls. */
(self, name: &str, target: &str)
| 76 | |
| 77 | /* Add an alias to the root manifest; additive, accumulates across calls. */ |
| 78 | pub fn with_alias(self, name: &str, target: &str) -> Self { |
| 79 | { |
| 80 | let mut s = self.state.borrow_mut(); |
| 81 | let m = s.manifests.entry(String::new()).or_insert_with(|| Manifest {imports: Vec::new(), extends: None}); |
| 82 | m.imports.push((name.to_string(), target.to_string())); |
| 83 | } |
| 84 | self |
| 85 | } |
| 86 | |
| 87 | /* Register a manifest at `dir`; nearer manifests win for bare-name resolution. */ |
| 88 | pub fn with_manifest(self, dir: &str, imports: &[(&str, &str)], extends: Option<&str>) -> Self { |