]>
git.proxmox.com Git - rustc.git/blob - vendor/codespan-reporting/tests/support/mod.rs
2 use codespan_reporting
::diagnostic
::Diagnostic
;
3 use codespan_reporting
::term
::{emit, Config}
;
4 use termcolor
::{Buffer, WriteColor}
;
8 use self::color_buffer
::ColorBuffer
;
12 pub diagnostics
: Vec
<Diagnostic
>,
16 fn emit
<W
: WriteColor
>(&self, mut writer
: W
, config
: &Config
) -> W
{
17 for diagnostic
in &self.diagnostics
{
18 emit(&mut writer
, config
, &self.files
, &diagnostic
).unwrap();
23 pub fn emit_color(&self, config
: &Config
) -> String
{
24 self.emit(ColorBuffer
::new(), &config
).into_string()
27 pub fn emit_no_color(&self, config
: &Config
) -> String
{
28 let buffer
= self.emit(Buffer
::no_color(), &config
);
29 String
::from_utf8_lossy(buffer
.as_slice()).into_owned()