pub fn load_key_map(data: &[u8]) -> FnvHashMap<DefKey, DefIndex> {
    let root_doc = rbml::Doc::new(data);
    let items_doc = reader::get_doc(root_doc, tag_items);
    let items_data_doc = reader::get_doc(items_doc, tag_items_data);
    reader::docs(items_data_doc)
        .filter(|&(tag, _)| tag == tag_items_data_item)
        .map(|(_, item_doc)| {
            // load def-key from item
            let key = item_def_key(item_doc);

            // load def-index from item; we only encode the full def-id,
            // so just pull out the index
            let def_id_doc = reader::get_doc(item_doc, tag_def_id);
            let def_id = untranslated_def_id(def_id_doc);
            assert!(def_id.is_local()); // local to the crate we are decoding, that is

            (key, def_id.index)
        })
        .collect()
}
// Go through each item in the metadata and create a map from that
// item's def-key to the item's DefIndex.
Go through each item in the metadata and create a map from that
item's def-key to the item's DefIndex.
Go through each item in the metadata and create a map from that item ' s def - key to the item ' s DefIndex .
pub fn load_key_map(data: &[u8]) -> FnvHashMap<DefKey, DefIndex> {
    let root_doc = rbml::Doc::new(data);
    let items_doc = reader::get_doc(root_doc, tag_items);
    let items_data_doc = reader::get_doc(items_doc, tag_items_data);
    reader::docs(items_data_doc)
        .filter(|&(tag, _)| tag == tag_items_data_item)
        .map(|(_, item_doc)| {
            // load def-key from item
            let key = item_def_key(item_doc);
            // load def-index from item; we only encode the full def-id,
            // so just pull out the index
            let def_id_doc = reader::get_doc(item_doc, tag_def_id);
            let def_id = untranslated_def_id(def_id_doc);
            assert!(def_id.is_local()); // local to the crate we are decoding, that is
            (key, def_id.index)
        })
        .collect()
}
pub fn load_key_map ( data : & [ u8 ] ) -> FnvHashMap < DefKey , DefIndex > { let root_doc = rbml :: Doc :: new ( data ) ; let items_doc = reader :: get_doc ( root_doc , tag_items ) ; let items_data_doc = reader :: get_doc ( items_doc , tag_items_data ) ; reader :: docs ( items_data_doc ) . filter ( | & ( tag , _ ) | tag == tag_items_data_item ) . map ( | ( _ , item_doc ) | { // load def-key from item let key = item_def_key ( item_doc ) ; // load def-index from item; we only encode the full def-id, // so just pull out the index let def_id_doc = reader :: get_doc ( item_doc , tag_def_id ) ; let def_id = untranslated_def_id ( def_id_doc ) ; assert ! ( def_id is_local ( ) ) ; // local to the crate we are decoding, that is ( key , def_id . index ) } ) . collect ( ) }
Go through each item in the metadata and create a map from that
item's def-key to the item's DefIndex.
Go through each item in the metadata and create a map from that item ' s def - key to the item ' s DefIndex .
data
&[u8]
data
&[u8]