pub fn std_deviation(data: &[usize]) -> Option<f64> {
...
}
pub struct CompanyEval {
pub final_value: usize,
}
let c_e: Vec<CompanyEval>;
let a: Vec<usize> = c_e.iter().map(|m| -> usize {m.final_value}).collect();
let value_stdev = crate::utils::std_deviation(&a).unwrap();
한 줄에 쓰면
a value of type `[usize]` cannot be built from an iterator over elements of type `usize`
the trait `FromIterator<usize>` is not implemented for `[usize]` (lsp)
라고 나옴...
c_e랑 std_deviation 타입이 뭔데
본 문에 추가했음
collect에 Vec 타입 인자를 주셈
아하, ㄳㄳ