首页 > TAG信息列表 > 变参
rust 变参
#[derive(Clone, Copy)] enum Args<'a> { Idx(usize), IdxList(&'a [usize]), } fn get_data<'a, T>(arr: &'a [T], idxs: Args<'a>) -> Vec<&'a T> { match idxs { Args::Idx(idrust 变参
#[derive(Clone, Copy)] enum Args<'a> { Idx(usize), IdxList(&'a [usize]), } fn get_data<'a, T>(arr: &'a [T], idxs: Args<'a>) -> Vec<&'a T> { match idxs { Args::Idx(id