1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use crate::utils::strcmp;
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct Vvc { pub attr: Vec<Vec<char>> }
impl Vvc {
pub fn new<'a>(attr: &'a str, sep: char) -> Self {
let split_text: Vec<&str> = attr.split(sep).collect();
let mut vvchar: Vec<Vec<char>> = split_text.iter()
.map(|&x| x.chars().collect())
.collect();
vvchar.shrink_to_fit();
Vvc { attr: vvchar }
}
pub fn find<'f>(&self, search_string: &'f str) -> bool {
for vc in &self.attr {
if strcmp(vc, search_string) {
return true;
}
}
false
}
}