fn flag_activated(&mut self,
                      summary: &Rc<Summary>,
                      method: &Method) -> bool {
        let id = summary.package_id();
        let key = (id.name().to_string(), id.source_id().clone());
        let prev = self.activations.entry(key).or_insert(Vec::new());
        if !prev.iter().any(|c| c == summary) {
            self.resolve.graph.add(id.clone(), &[]);
            prev.push(summary.clone());
            return false
        }
        debug!("checking if {} is already activated", summary.package_id());
        let (features, use_default) = match *method {
            Method::Required { features, uses_default_features, .. } => {
                (features, uses_default_features)
            }
            Method::Everything => return false,
        };

        let has_default_feature = summary.features().contains_key("default");
        match self.resolve.features(id) {
            Some(prev) => {
                features.iter().all(|f| prev.contains(f)) &&
                    (!use_default || prev.contains("default") ||
                     !has_default_feature)
            }
            None => features.is_empty() && (!use_default || !has_default_feature)
        }
    }
// Activate this summary by inserting it into our list of known activations.
//
// Returns if this summary with the given method is already activated.
Activate this summary by inserting it into our list of known activations.
Returns if this summary with the given method is already activated.
Activate this summary by inserting it into our list of known activations . Returns if this summary with the given method is already activated .
fn flag_activated(&mut self,
                      summary: &Rc<Summary>,
                      method: &Method) -> bool {
        let id = summary.package_id();
        let key = (id.name().to_string(), id.source_id().clone());
        let prev = self.activations.entry(key).or_insert(Vec::new());
        if !prev.iter().any(|c| c == summary) {
            self.resolve.graph.add(id.clone(), &[]);
            prev.push(summary.clone());
            return false
        }
        debug!("checking if {} is already activated", summary.package_id());
        let (features, use_default) = match *method {
            Method::Required { features, uses_default_features, .. } => {
                (features, uses_default_features)
            }
            Method::Everything => return false,
        };
        let has_default_feature = summary.features().contains_key("default");
        match self.resolve.features(id) {
            Some(prev) => {
                features.iter().all(|f| prev.contains(f)) &&
                    (!use_default || prev.contains("default") ||
                     !has_default_feature)
            }
            None => features.is_empty() && (!use_default || !has_default_feature)
        }
    }
fn flag_activated ( & mut self , summary : & Rc < Summary > , method : & Method ) -> bool { let id = summary . package_id ( ) ; let key = ( id . name ( ) . to_string ( ) , id . source_id ( ) . clone ( ) ) ; let prev = self . activations . entry ( key ) . or_insert ( Vec :: new ( ) ) ; if ! prev . iter ( ) . any ( | c | c == summary ) { self . resolve . graph . add ( id . clone ( ) , & [ ] ) ; prev . push ( summary . clone ( ) ) ; return false } debug ! ( " " summary package_id ( ) ) ; let ( features , use_default ) = match * method { Method :: Required { features , uses_default_features , .. } => { ( features , uses_default_features ) } Method :: Everything => return false , } ; let has_default_feature = summary . features ( ) . contains_key ( " " ) ; match self . resolve . features ( id ) { Some ( prev ) => { features . iter ( ) . all ( | f | prev . contains ( f ) ) && ( ! use_default || prev . contains ( " " ) || ! has_default_feature ) } None => features . is_empty ( ) && ( ! use_default || ! has_default_feature ) } }
Activate this summary by inserting it into our list of known activations.
Activate this summary by inserting it into our list of known activations .
&mut self
summary
&Rc<Summary>
method
&Method
&mut self
summary
&Rc<Summary>
method
&Method