Change DocFragments from enum variant fields to structs with a nested enum

This makes the code a lot easier to work with. It also makes it easier
to add new fields without updating each variant and `match`
individually.

- Name the `Kind` variant after `DocFragmentKind` from `collapse_docs`
- Remove unneeded impls
This commit is contained in:
Joshua Nelson
2020-10-03 19:15:27 -04:00
parent 782013564e
commit 5f76b95e9b
5 changed files with 50 additions and 90 deletions

View File

@@ -232,7 +232,12 @@ impl fold::DocFolder for CoverageCalculator {
let mut tests = Tests { found_tests: 0 };
find_testable_code(
&i.attrs.doc_strings.iter().map(|d| d.as_str()).collect::<Vec<_>>().join("\n"),
&i.attrs
.doc_strings
.iter()
.map(|d| d.doc.as_str())
.collect::<Vec<_>>()
.join("\n"),
&mut tests,
ErrorCodes::No,
false,