I want to know if it possible to boolean a String contains a digit between an another digit to set a variable after
the code i tried
pub fn ram() -> String {
let okmdr = Command::new("wmic").arg("memorychip").arg("get").arg("speed").output().unwrap_or_else(|e| panic!("impossible d'obtenir le type et la vitesse de la RAM"));
let speed = String::from_utf8_lossy(&okmdr.stdout).to_string();
let split: Vec<String> = speed.split_inclusive("Speed").map(|s| s.to_string()).collect();
let splitjsp: Vec<String> = split[1].split(" ").map(|o| o.to_string()).collect();
let jsp = if splitjsp[2].contains(1601..3200) { String::from("DDR4") } else if splitjsp[2].contains(0..1600) { String::from("DDR3") } else { String::from("Unknown")};
jsp
}
the error i got :
let jsp = if splitjsp[2].contains(1601..3200) { String::from("DDR4") } else if splitjsp[2].contains(0..1600) { String::from("DDR3") }...
-------- ^^^^^^^^^^ expected an `FnMut<(char,)>` closure, found `std::ops::Range<{integer}>`
|
required by a bound introduced by this call