pub(crate) fn find_named_spec(&self, name: &str) -> Option<&Spec> {
        let mut result: Option<&Spec> = None;
        for s in &self.specs {
            if s.is_named() {
                if s.name == name {
                    result = Some(s);
                    break;
                } else if let Some(sn) = s.short_name {
                    if name.len() == 1 && name.starts_with(sn) {
                        result = result.or_else(|| Some(s));
                    }
                }
            }
        }
        result
    }
/// Given an iterator over a collection of Specs, locate the first Spec
/// which matches the given name. The given name might either be a short
/// name or a long name, depending on how it was specified on the command
/// line.
Given an iterator over a collection of Specs, locate the first Spec
which matches the given name. The given name might either be a short
name or a long name, depending on how it was specified on the command
line.
Given an iterator over a collection of Specs locate the first Spec which matches the given name . The given name might either be a short name or a long name depending on how it was specified on the command line .
pub(crate) fn find_named_spec(&self, name: &str) -> Option<&Spec> {
        let mut result: Option<&Spec> = None;
        for s in &self.specs {
            if s.is_named() {
                if s.name == name {
                    result = Some(s);
                    break;
                } else if let Some(sn) = s.short_name {
                    if name.len() == 1 && name.starts_with(sn) {
                        result = result.or_else(|| Some(s));
                    }
                }
            }
        }
        result
    }
pub ( crate ) fn find_named_spec ( & self , name : & str ) -> Option < & Spec > { let mut result : Option < & Spec > = None ; for s in & self . specs { if s . is_named ( ) { if s . name == name { result = Some ( s ) ; break ; } else if let Some ( sn ) = s . short_name { if name . len ( ) == 1 && name . starts_with ( sn ) { result = result . or_else ( | | Some ( s ) ) ; } } } } result }
Given an iterator over a collection of Specs, locate the first Spec
which matches the given name.
Given an iterator over a collection of Specs locate the first Spec which matches the given name .
&self
name
&str
&self
name
&str