aboutsummaryrefslogtreecommitdiff
path: root/src/filecache.rs
blob: 287cea015bd1a624a034022804d32cce1e0214a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::vector::FileVector;

pub struct FileCache {
    pub vector : FileVector,
    pub path : String,
}

impl FileCache {
    pub fn from_line(line : String) -> Self {
        let ls : Vec<String> = line.split(',').map(|s| s.to_string()).collect();
        let v = FileVector::from_string(ls[1].clone());
        let p = ls[0].clone().replace('\0', ",");
        Self {
            vector : v,
            path : p
        }
    }
}