Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Dec 1, 2024
1 parent e0af425 commit 95f3886
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion v0.5/fastn-core/src/config/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ fn desugar_auto_imports(
arena: &mut fastn_unresolved::Arena,
_auto_imports: &[fastn_core::config::AutoImport],
) -> fastn_unresolved::AliasesID {
arena.new_aliases()
let id = arena.new_aliases();
let aliases = arena.aliases.get_mut(id).unwrap();
aliases.insert("ftd".to_string(), "ftd".to_string());
id
}
7 changes: 7 additions & 0 deletions v0.5/fastn-unresolved/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ impl fastn_unresolved::Symbol {
arena.interner.resolve(self.interned).unwrap()
}

pub fn base<'a>(&self, arena: &'a fastn_unresolved::Arena) -> &'a str {
&self.str(
arena[..self.package_len.get() as usize
+ self.module_len.map(|v| v.get() + 1).unwrap_or(0) as usize],
)
}

pub fn string(&self, arena: &fastn_unresolved::Arena) -> String {
self.str(arena).to_string()
}
Expand Down

0 comments on commit 95f3886

Please sign in to comment.