pub fn filter_targets(&self, targets: &TargetSet) -> Option<SourceGroup<'ctx>> {
        if !self.target.matches(targets) {
            return None;
        }
        let files = self
            .files
            .iter()
            .filter_map(|file| match *file {
                SourceFile::Group(ref group) => group
                    .filter_targets(targets)
                    .map(|g| SourceFile::Group(Box::new(g))),
                ref other => Some(other.clone()),
            })
            .collect();
        Some(
            SourceGroup {
                package: self.package,
                independent: self.independent,
                target: self.target.clone(),
                include_dirs: self.include_dirs.clone(),
                export_incdirs: self.export_incdirs.clone(),
                defines: self.defines.clone(),
                files: files,
                dependencies: self.dependencies.clone(),
            }
            .simplify(),
        )
    }
/// Filter the sources, keeping only the ones that apply to a target.
Filter the sources, keeping only the ones that apply to a target.
Filter the sources keeping only the ones that apply to a target .
pub fn filter_targets(&self, targets: &TargetSet) -> Option<SourceGroup<'ctx>> {
        if !self.target.matches(targets) {
            return None;
        }
        let files = self
            .files
            .iter()
            .filter_map(|file| match *file {
                SourceFile::Group(ref group) => group
                    .filter_targets(targets)
                    .map(|g| SourceFile::Group(Box::new(g))),
                ref other => Some(other.clone()),
            })
            .collect();
        Some(
            SourceGroup {
                package: self.package,
                independent: self.independent,
                target: self.target.clone(),
                include_dirs: self.include_dirs.clone(),
                export_incdirs: self.export_incdirs.clone(),
                defines: self.defines.clone(),
                files: files,
                dependencies: self.dependencies.clone(),
            }
            .simplify(),
        )
    }
pub fn filter_targets ( & self , targets : & TargetSet ) -> Option < SourceGroup < ' ctx > > { if ! self . target . matches ( targets ) { return None ; } let files = self . files . iter ( ) . filter_map ( | file | match * file { SourceFile :: Group ( ref group ) => group . filter_targets ( targets ) . map ( | g | SourceFile :: Group ( Box :: new ( g ) ) ) , ref other => Some ( other . clone ( ) ) , } ) . collect ( ) ; Some ( SourceGroup { package : self . package , independent : self . independent , target : self . target . clone ( ) , include_dirs : self . include_dirs . clone ( ) , export_incdirs : self . export_incdirs . clone ( ) , defines : self . defines . clone ( ) , files : files , dependencies : self . dependencies . clone ( ) , } . simplify ( ) , ) }
Filter the sources, keeping only the ones that apply to a target.
Filter the sources keeping only the ones that apply to a target .
&self
targets
&TargetSet
&self
targets
&TargetSet