(comments: (&usize, &Rc<Vec<Comment>>))
| 221 | } |
| 222 | |
| 223 | fn comments_to_test_str(comments: (&usize, &Rc<Vec<Comment>>)) -> String { |
| 224 | let mut text = String::new(); |
| 225 | text.push_str("{\n"); |
| 226 | text.push_str(&format!(" \"pos\": {},\n", comments.0)); |
| 227 | text.push_str(" \"comments\": ["); |
| 228 | let comments_count = comments.1.len(); |
| 229 | for (i, comment) in comments.1.iter().enumerate() { |
| 230 | text.push_str("\n "); |
| 231 | text.push_str(&comment_to_test_str(comment).replace("\n", "\n ")); |
| 232 | if i + 1 < comments_count { |
| 233 | text.push(','); |
| 234 | } |
| 235 | } |
| 236 | text.push_str("\n ]\n"); |
| 237 | text.push('}'); |
| 238 | text |
| 239 | } |
| 240 | |
| 241 | fn comment_to_test_str(comment: &Comment) -> String { |
| 242 | match comment { |
no test coverage detected
searching dependent graphs…