heddle-cli-render 0.28.3

Heddle's terminal presentation layer.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// SPDX-License-Identifier: Apache-2.0
//! Terminal Adapter for structured library warnings.

use objects::{Warning, WarningSink};

/// Render structured warnings on stderr for the human CLI surface.
#[derive(Debug, Default, Clone, Copy)]
pub struct StderrWarningSink;

impl WarningSink for StderrWarningSink {
    fn warn(&self, warning: Warning) {
        eprintln!(
            "{} {}",
            super::style::warn_marker(),
            super::style::human_text(&warning.message)
        );
    }
}