~gbmor/rustwtxt

d94bb0c2ffc9789014ef0000b60fb32488679749 — Ben Morrison 1 year, 10 months ago be43a7a
further check for improperly formatted statuses
2 files changed, 3 insertions(+), 3 deletions(-)

M src/lib.rs
M src/parse.rs
M src/lib.rs => src/lib.rs +1 -1
@@ 71,7 71,7 @@ impl Twtxt {
            .collect::<Vec<&str>>()
            .iter()
            .for_each(|line| {
                if line.starts_with("#") || line == &"" {
                if line.starts_with("#") || line == &"" || !line.contains("\t") {
                    return;
                }
                let tweet = Tweet::from_str(line);

M src/parse.rs => src/parse.rs +2 -2
@@ 52,7 52,7 @@ pub fn statuses(twtxt: &str) -> Option<BTreeMap<String, String>> {
    let mut map = BTreeMap::new();
    let lines = twtxt.split("\n").collect::<Vec<&str>>();
    lines.iter().for_each(|line| {
        if line.starts_with("#") || line.len() < 1 {
        if line.starts_with("#") || line.len() < 2 || !line.contains("\t") {
            return;
        }



@@ 93,7 93,7 @@ pub fn mentions(twtxt: &str) -> Option<BTreeMap<String, String>> {
            return;
        };

        let mention = out[2..out.len() - 1].to_string();
        let mention = out.to_string();
        map.insert(k.to_string(), mention);
    });