(context: &(dyn Error + Send + Sync + 'static), mode: ColorMode)
| 778 | } |
| 779 | |
| 780 | fn debug_context(context: &(dyn Error + Send + Sync + 'static), mode: ColorMode) -> Lines { |
| 781 | context |
| 782 | .to_string() |
| 783 | .lines() |
| 784 | .map(ToOwned::to_owned) |
| 785 | .enumerate() |
| 786 | .map(|(idx, value)| { |
| 787 | if idx == 0 { |
| 788 | let mut style = Style::new(); |
| 789 | |
| 790 | if mode == ColorMode::Color || mode == ColorMode::Emphasis { |
| 791 | style.set_display(DisplayStyle::new().with_bold(true)); |
| 792 | } |
| 793 | |
| 794 | Line::new().push(Instruction::Value { value, style }) |
| 795 | } else { |
| 796 | Line::new().push(Instruction::Value { |
| 797 | value, |
| 798 | style: Style::new(), |
| 799 | }) |
| 800 | } |
| 801 | }) |
| 802 | .collect() |
| 803 | } |
| 804 | |
| 805 | struct Opaque(usize); |
| 806 |
no test coverage detected