(line: &str, key: &str)
| 716 | } |
| 717 | |
| 718 | fn capture_parenthesized_token(line: &str, key: &str) -> Option<String> { |
| 719 | let marker = format!("{key} "); |
| 720 | let start = line.find(&marker)? + marker.len(); |
| 721 | let rest = line[start..].trim_start(); |
| 722 | if !rest.starts_with('(') { |
| 723 | return None; |
| 724 | } |
| 725 | |
| 726 | let mut depth = 0usize; |
| 727 | let mut output = String::new(); |
| 728 | for ch in rest.chars() { |
| 729 | match ch { |
| 730 | '(' => { |
| 731 | depth = depth.saturating_add(1); |
| 732 | if depth > 1 { |
| 733 | output.push(ch); |
| 734 | } |
| 735 | } |
| 736 | ')' => { |
| 737 | if depth == 1 { |
| 738 | return Some(output); |
| 739 | } |
| 740 | if depth > 1 { |
| 741 | output.push(ch); |
| 742 | } |
| 743 | depth = depth.saturating_sub(1); |
| 744 | } |
| 745 | _ => { |
| 746 | if depth >= 1 { |
| 747 | output.push(ch); |
| 748 | } |
| 749 | } |
| 750 | } |
| 751 | } |
| 752 | |
| 753 | None |
| 754 | } |
| 755 | |
| 756 | fn parse_headers(literal: &[u8]) -> BTreeMap<String, String> { |
| 757 | let mut headers: BTreeMap<String, String> = BTreeMap::new(); |
no outgoing calls
no test coverage detected