(&self)
| 745 | } |
| 746 | |
| 747 | pub fn files(&self) -> Result<Vec<(RepoId, PathBuf, String)>> { |
| 748 | let mut files = vec![]; |
| 749 | |
| 750 | for (key, index) in &self.search_tokens { |
| 751 | files.push((key.repo_id, index.filename().to_owned(), index.serialize()?)); |
| 752 | } |
| 753 | |
| 754 | for (key, index) in &self.synonym_phrases { |
| 755 | files.push((key.repo_id, index.filename().to_owned(), index.serialize()?)); |
| 756 | } |
| 757 | |
| 758 | for (key, index) in &self.synonym_tokens { |
| 759 | files.push((key.repo_id, index.filename().to_owned(), index.serialize()?)); |
| 760 | } |
| 761 | |
| 762 | for ((repo_id, _id), activity_log) in &self.path_activity { |
| 763 | files.push(( |
| 764 | *repo_id, |
| 765 | activity_log.filename().to_owned(), |
| 766 | activity_log.serialize()?, |
| 767 | )); |
| 768 | } |
| 769 | |
| 770 | for (&repo_id, changes) in &self.repo_changes { |
| 771 | for change in changes { |
| 772 | let reference = change.to_reference(); |
| 773 | files.push(( |
| 774 | repo_id, |
| 775 | reference.id.change_filename()?, |
| 776 | serde_yaml::to_string(&change)?, |
| 777 | )); |
| 778 | } |
| 779 | } |
| 780 | |
| 781 | Ok(files) |
| 782 | } |
| 783 | |
| 784 | pub fn write_repo_changes<S>(&self, store: &S) -> Result<()> |
| 785 | where |
no test coverage detected