Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ welcome!
```rust
use codespan_reporting::diagnostic::{Diagnostic, Label};
use codespan_reporting::files::SimpleFiles;
use codespan_reporting::term::termcolor::{ColorChoice, StandardStream};
use codespan_reporting::term::{self, termcolor::{ColorChoice, StandardStream}};

// `files::SimpleFile` and `files::SimpleFiles` help you get up and running with
// `codespan-reporting` quickly! More complicated use cases can be supported
Expand Down Expand Up @@ -93,7 +93,9 @@ let diagnostic = Diagnostic::error()
let writer = StandardStream::stderr(ColorChoice::Always);
let config = codespan_reporting::term::Config::default();

term::emit(&mut writer.lock(), &config, &files, &diagnostic)?;
term::emit_to_write_style(&mut writer.lock(), &config, &files, &diagnostic)?;

Ok::<(), codespan_reporting::files::Error>(())
```

## Running the CLI example
Expand Down
7 changes: 5 additions & 2 deletions codespan-reporting/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Diagnostic reporting support for the codespan crate.

// README examples require `termcolor`, thus the guard here
#![cfg_attr(
feature = "termcolor",
doc = include_str!("../../README.md")
)]
#![forbid(unsafe_code)]
#![cfg_attr(not(feature = "std"), no_std)]

Expand Down