Skip to main content

default_import_alias

Function default_import_alias 

Source
pub fn default_import_alias(module: &str) -> String
Expand description

The alias a module binds to when the import writes no explicit as — the module reference’s last path segment, splitting on either . (stdlib, std.sqlsql) or / (local/package, ./errorerror, lex-web/liblib). Lex actually requires an explicit alias on every import, so this is not a language default; it is the convention AddImport uses to decide when an alias can be omitted from the op (keeping the OpId stable) and export-git uses to reconstruct it. The two MUST agree, so both call this one function.