pub fn target_filenames(&self, unit: &Unit) -> CargoResult<Vec<String>> {
        let stem = self.file_stem(unit);
        let suffix = if unit.target.for_host() {
            &self.host_exe
        } else {
            &self.target_exe
        };

        let mut ret = Vec::new();
        match *unit.target.kind() {
            TargetKind::Example | TargetKind::Bin | TargetKind::CustomBuild |
            TargetKind::Bench | TargetKind::Test => {
                ret.push(format!("{}{}", stem, suffix));
            }
            TargetKind::Lib(..) if unit.profile.test => {
                ret.push(format!("{}{}", stem, suffix));
            }
            TargetKind::Lib(ref libs) => {
                for lib in libs.iter() {
                    match *lib {
                        LibKind::Dylib => {
                            if let Ok((prefix, suffix)) = self.dylib(unit.kind) {
                                ret.push(format!("{}{}{}", prefix, stem, suffix));
                            }
                        }
                        LibKind::Lib |
                        LibKind::Rlib => ret.push(format!("lib{}.rlib", stem)),
                        LibKind::StaticLib => {
                            if let Ok((prefix, suffix)) = self.staticlib(unit.kind) {
                                ret.push(format!("{}{}{}", prefix, stem, suffix));
                            }
                        }
                    }
                }
            }
        }
        assert!(!ret.is_empty());
        Ok(ret)
    }
/// Return the filenames that the given target for the given profile will
/// generate.
Return the filenames that the given target for the given profile will
generate.
Return the filenames that the given target for the given profile will generate .
pub fn target_filenames(&self, unit: &Unit) -> CargoResult<Vec<String>> {
        let stem = self.file_stem(unit);
        let suffix = if unit.target.for_host() {
            &self.host_exe
        } else {
            &self.target_exe
        };
        let mut ret = Vec::new();
        match *unit.target.kind() {
            TargetKind::Example | TargetKind::Bin | TargetKind::CustomBuild |
            TargetKind::Bench | TargetKind::Test => {
                ret.push(format!("{}{}", stem, suffix));
            }
            TargetKind::Lib(..) if unit.profile.test => {
                ret.push(format!("{}{}", stem, suffix));
            }
            TargetKind::Lib(ref libs) => {
                for lib in libs.iter() {
                    match *lib {
                        LibKind::Dylib => {
                            if let Ok((prefix, suffix)) = self.dylib(unit.kind) {
                                ret.push(format!("{}{}{}", prefix, stem, suffix));
                            }
                        }
                        LibKind::Lib |
                        LibKind::Rlib => ret.push(format!("lib{}.rlib", stem)),
                        LibKind::StaticLib => {
                            if let Ok((prefix, suffix)) = self.staticlib(unit.kind) {
                                ret.push(format!("{}{}{}", prefix, stem, suffix));
                            }
                        }
                    }
                }
            }
        }
        assert!(!ret.is_empty());
        Ok(ret)
    }
pub fn target_filenames ( & self , unit : & Unit ) -> CargoResult < Vec < String > > { let stem = self . file_stem ( unit ) ; let suffix = if unit . target . for_host ( ) { & self . host_exe } else { & self . target_exe } ; let mut ret = Vec :: new ( ) ; match * unit . target . kind ( ) { TargetKind :: Example | TargetKind :: Bin | TargetKind :: CustomBuild | TargetKind :: Bench | TargetKind :: Test => { ret . push ( format ! ( " " stem suffix ) ) ; } TargetKind :: Lib ( .. ) if unit . profile . test => { ret . push ( format ! ( " " stem suffix ) ) ; } TargetKind :: Lib ( ref libs ) => { for lib in libs . iter ( ) { match * lib { LibKind :: Dylib => { if let Ok ( ( prefix , suffix ) ) = self . dylib ( unit . kind ) { ret . push ( format ! ( " " prefix stem suffix ) ) ; } } LibKind :: Lib | LibKind :: Rlib => ret . push ( format ! ( " " stem ) ) , LibKind :: StaticLib => { if let Ok ( ( prefix , suffix ) ) = self . staticlib ( unit . kind ) { ret . push ( format ! ( " " prefix stem suffix ) ) ; } } } } } } assert ! ( ret is_empty ( ) ) ; Ok ( ret ) }
Return the filenames that the given target for the given profile will
generate.
Return the filenames that the given target for the given profile will generate .
&self
unit
&Unit
&self
unit
&Unit