pub fn autodetect<'a>(number: &str, nums: Vec<&'a NumeralSystem>) -> Option<&'a NumeralSystem> {
        let res: Vec<&'a NumeralSystem> = nums
            .into_iter()
            .filter(|ns| (ns.prefix.len() > 0) && (ns.prefix[..] == number[0..ns.prefix.len()]))
            .collect();
        if res.len() == 1 {
            return Some(res[0]);
        }
        None
    }
// static method to find out a numeral system by its prefix given a number
static method to find out a numeral system by its prefix given a number
static method to find out a numeral system by its prefix given a number
pub fn autodetect<'a>(number: &str, nums: Vec<&'a NumeralSystem>) -> Option<&'a NumeralSystem> {
        let res: Vec<&'a NumeralSystem> = nums
            .into_iter()
            .filter(|ns| (ns.prefix.len() > 0) && (ns.prefix[..] == number[0..ns.prefix.len()]))
            .collect();
        if res.len() == 1 {
            return Some(res[0]);
        }
        None
    }
pub fn autodetect < ' a > ( number : & str , nums : Vec < & ' a NumeralSystem > ) -> Option < & ' a NumeralSystem > { let res : Vec < & ' a NumeralSystem > = nums . into_iter ( ) . filter ( | ns | ( ns . prefix . len ( ) > 0 ) && ( ns . prefix [ .. ] == number [ 0 .. ns . prefix . len ( ) ] ) ) . collect ( ) ; if res . len ( ) == 1 { return Some ( res [ 0 ] ) ; } None }
static method to find out a numeral system by its prefix given a number
static method to find out a numeral system by its prefix given a number
number
&str
nums
Vec<&'a NumeralSystem>
number
&str
nums
Vec<&'a NumeralSystem>