I am getting confused with some code from Rust but I am managing it. But I have problem in understanding how the function iter()
work in Rust. What is the possible result for a String?
Edit
impl Selector {
pub fn specificity(&self) -> Specificity {
// http://www.w3.org/TR/selectors/#specificity
let Selector::Simple(ref simple) = *self;
let a = simple.id.iter().len();
let b = simple.class.len();
let c = simple.tag_name.iter().len();
(a, b, c)
}
}
Where simple.id
is string
.