// A diagnostic function for dumping crate metadata to an output stream
A diagnostic function for dumping crate metadata to an output stream
A diagnostic function for dumping crate metadata to an output stream
pub fn list_file_metadata(target: &Target, path: &Path,
                          out: &mut io::Write) -> io::Result<()> {
    let filename = path.file_name().unwrap().to_str().unwrap();
    let flavor = if filename.ends_with(".rlib") { CrateFlavor::Rlib } else { CrateFlavor::Dylib };
    match get_metadata_section(target, flavor, path) {
        Ok(bytes) => decoder::list_crate_metadata(bytes.as_slice(), out),
        Err(msg) => {
            write!(out, "{}\n", msg)
        }
    }
}
pub fn list_file_metadata ( target : & Target , path : & Path , out : & mut io :: Write ) -> io :: Result < ( ) > { let filename = path . file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ; let flavor = if filename . ends_with ( " " ) { CrateFlavor :: Rlib } else { CrateFlavor :: Dylib } ; match get_metadata_section ( target , flavor , path ) { Ok ( bytes ) => decoder :: list_crate_metadata ( bytes . as_slice ( ) , out ) , Err ( msg ) => { write ! ( out " \n " msg ) } } }
A diagnostic function for dumping crate metadata to an output stream
A diagnostic function for dumping crate metadata to an output stream
target
&Target
path
&Path
out
&mut io::Write