MCPcopy Index your code
hub / github.com/emwalker/digraph / delete_topic

Function delete_topic

backend/src/git/activity.rs:1337–1361  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1335
1336 #[test]
1337 fn delete_topic() {
1338 let link = link("Reddit", "http://www.reddit.com");
1339 let topic1 = topic("Climate change");
1340 let topic2 = topic("Weather");
1341
1342 let change = Change::DeleteTopic(DeleteTopic {
1343 actor_id: "2".to_owned(),
1344 child_links: LinkInfoList(BTreeSet::from([LinkInfo::from(&link)])),
1345 child_topics: TopicInfoList(BTreeSet::new()),
1346 date: chrono::Utc::now(),
1347 deleted_topic: TopicInfo::from(&topic1),
1348 id: Change::new_id(),
1349 parent_topics: TopicInfoList(BTreeSet::from([TopicInfo::from(&topic2)])),
1350 });
1351
1352 assert_eq!(
1353 change.markdown(Locale::EN, "Gnusto", None),
1354 format!(
1355 "Gnusto deleted [Climate change]({}), removing [Reddit](http://www.reddit.com) from it, and \
1356 removing it from [Weather]({})",
1357 topic1.relative_url(),
1358 topic2.relative_url(),
1359 )
1360 );
1361 }
1362
1363 mod update_topic_parent_topics {
1364 use super::*;

Callers

nothing calls this directly

Calls 5

topicFunction · 0.85
LinkInfoListClass · 0.85
TopicInfoListClass · 0.85
linkFunction · 0.70
DeleteTopicClass · 0.70

Tested by

no test coverage detected