Make title on comment optional.

This commit is contained in:
2019-01-22 11:36:31 +01:00
parent b163e3c0fc
commit a1d11c976d
3 changed files with 56 additions and 47 deletions

View File

@@ -72,7 +72,7 @@ fn from_html(document: &str) -> Result<Entry, ()> {
(comment.timestamp / 1000) as i64,
(comment.timestamp % 1000) as u32,
),
title: "".to_string(),
title: None,
message: comment.comment,
});
}
@@ -142,147 +142,147 @@ mod tests {
comments: vec![
probe::Comment {
datetime: "2019-01-17T17:29:22Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Varmsälj från Folksam".to_string(),
},
probe::Comment {
datetime: "2018-12-14T13:45:28Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam".to_string(),
},
probe::Comment {
datetime: "2018-11-28T07:30:18Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Höglandschskt".to_string(),
},
probe::Comment {
datetime: "2018-11-20T19:18:09Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Försäljare ".to_string(),
},
probe::Comment {
datetime: "2018-11-19T17:38:34Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "mögg från Folksam".to_string(),
},
probe::Comment {
datetime: "2018-11-12T16:00:41Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam försäkringsförsäljare".to_string(),
},
probe::Comment {
datetime: "2018-10-25T10:28:36Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "folksam".to_string(),
},
probe::Comment {
datetime: "2018-10-10T07:30:40Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Telefonförsäljare".to_string(),
},
probe::Comment {
datetime: "2018-10-04T10:04:55Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam säljare".to_string(),
},
probe::Comment {
datetime: "2018-10-03T13:55:19Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Sa inget.".to_string(),
},
probe::Comment {
datetime: "2018-08-24T16:56:46Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam".to_string(),
},
probe::Comment {
datetime: "2018-08-24T09:42:43Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Achmati azmut från folksam".to_string(),
},
probe::Comment {
datetime: "2018-08-21T18:29:29Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam".to_string(),
},
probe::Comment {
datetime: "2018-08-16T18:56:56Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Säljare från Folksam.".to_string(),
},
probe::Comment {
datetime: "2018-08-16T14:48:59Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam ".to_string(),
},
probe::Comment {
datetime: "2018-08-09T16:30:28Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam".to_string(),
},
probe::Comment {
datetime: "2018-08-02T16:29:32Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam ".to_string(),
},
probe::Comment {
datetime: "2018-08-02T15:33:38Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam ".to_string(),
},
probe::Comment {
datetime: "2018-07-25T08:28:27Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Säljare Folksam".to_string(),
},
probe::Comment {
datetime: "2018-07-17T21:20:51Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Inga Hansson ".to_string(),
},
probe::Comment {
datetime: "2018-07-16T18:11:46Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam".to_string(),
},
probe::Comment {
datetime: "2018-07-06T15:45:46Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam ".to_string(),
},
probe::Comment {
datetime: "2018-07-05T17:24:07Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "folksam".to_string(),
},
probe::Comment {
datetime: "2018-07-05T11:15:02Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Vesran".to_string(),
},
probe::Comment {
datetime: "2018-07-04T13:30:49Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam".to_string(),
},
probe::Comment {
datetime: "2018-06-29T10:52:51Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "folksam".to_string(),
},
probe::Comment {
datetime: "2018-06-28T13:33:01Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Säljare folksam".to_string(),
},
probe::Comment {
datetime: "2018-06-28T07:42:42Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Folksam försäkringar".to_string(),
},
probe::Comment {
datetime: "2018-06-26T12:59:33Z".parse::<DateTime<Utc>>().unwrap(),
title: "".to_string(),
title: None,
message: "Säljare Folksam".to_string(),
},
],