| 1532 | } |
| 1533 | |
| 1534 | fn change(topic: &RepoTopic, previous: Option<Timerange>) -> Change { |
| 1535 | let mut parent_topics = BTreeSet::new(); |
| 1536 | for parent in &topic.parent_topics { |
| 1537 | parent_topics.insert(parent.id.to_owned()); |
| 1538 | } |
| 1539 | |
| 1540 | Change::RemoveTopicTimerange(RemoveTopicTimerange { |
| 1541 | actor_id: "2".to_owned(), |
| 1542 | date: chrono::Utc::now(), |
| 1543 | id: Change::new_id(), |
| 1544 | parent_topics: parent_topics.iter().map(|path| path.to_owned()).collect(), |
| 1545 | previous_timerange: previous, |
| 1546 | updated_topic: TopicInfo::from(topic), |
| 1547 | }) |
| 1548 | } |
| 1549 | |
| 1550 | #[test] |
| 1551 | fn simple_case() { |