fn value_ns_kind(def: Def, path_str: &str) -> Option<(&'static str, String)> {
    match def {
        // structs, variants, and mods exist in both namespaces. skip them
        Def::StructCtor(..) | Def::Mod(..) | Def::Variant(..) | Def::VariantCtor(..) => None,
        Def::Fn(..)
            => Some(("function", format!("{}()", path_str))),
        Def::Method(..)
            => Some(("method", format!("{}()", path_str))),
        Def::Const(..)
            => Some(("const", format!("const@{}", path_str))),
        Def::Static(..)
            => Some(("static", format!("static@{}", path_str))),
        _ => Some(("value", format!("value@{}", path_str))),
    }
}
/// Given a def, returns its name and disambiguator
/// for a value namespace
///
/// Returns None for things which cannot be ambiguous since
/// they exist in both namespaces (structs and modules)
Given a def, returns its name and disambiguator
for a value namespace

Returns None for things which cannot be ambiguous since
they exist in both namespaces (structs and modules)
Given a def returns its name and disambiguator for a value namespace Returns None for things which cannot be ambiguous since they exist in both namespaces ( structs and modules )
fn value_ns_kind(def: Def, path_str: &str) -> Option<(&'static str, String)> {
    match def {
        // structs, variants, and mods exist in both namespaces. skip them
        Def::StructCtor(..) | Def::Mod(..) | Def::Variant(..) | Def::VariantCtor(..) => None,
        Def::Fn(..)
            => Some(("function", format!("{}()", path_str))),
        Def::Method(..)
            => Some(("method", format!("{}()", path_str))),
        Def::Const(..)
            => Some(("const", format!("const@{}", path_str))),
        Def::Static(..)
            => Some(("static", format!("static@{}", path_str))),
        _ => Some(("value", format!("value@{}", path_str))),
    }
}
fn value_ns_kind ( def : Def , path_str : & str ) -> Option < ( & ' static str , String ) > { match def { // structs, variants, and mods exist in both namespaces. skip them Def :: StructCtor ( .. ) | Def :: Mod ( .. ) | Def :: Variant ( .. ) | Def :: VariantCtor ( .. ) => None , Def :: Fn ( .. ) => Some ( ( " " , format ! ( " " path_str ) ) ) , Def :: Method ( .. ) => Some ( ( " " , format ! ( " " path_str ) ) ) , Def :: Const ( .. ) => Some ( ( " " , format ! ( " " path_str ) ) ) , Def :: Static ( .. ) => Some ( ( " " , format ! ( " " path_str ) ) ) , _ => Some ( ( " " , format ! ( " " path_str ) ) ) , } }
Given a def, returns its name and disambiguator
for a value namespace
Given a def returns its name and disambiguator for a value namespace
def
Def
path_str
&str