aboutsummaryrefslogtreecommitdiff
path: root/src/util/serialization.rs
blob: 61b3a835b13f21fb5b13e3d4535f8509ee70ab77 (plain)
1
2
3
4
5
6
7
8
9
10
pub fn line_to_words(line: &str) -> Vec<String> {
    line.split('|')
        .map(|w| w.trim().to_string())
        .filter(|w| !w.is_empty())
        .collect()
}

pub fn words_to_line(words: &[String]) -> String {
    words.join(" | ")
}