Skip to content

Commit 9a38e54

Browse files
committed
final push hopefully
1 parent a0823eb commit 9a38e54

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Add the following to your toml file:
2121
```toml
2222
[dependencies]
2323
eyre = "0.3.8"
24-
color-eyre = "0.1"
24+
color-eyre = "0.2"
2525
```
2626

2727
And then import the type alias from color-eyre for [`eyre::Report`] or [`eyre::Result`].
@@ -45,7 +45,7 @@ tracing integration to cut down on unused dependencies:
4545
```toml
4646
[dependencies]
4747
eyre = "0.3.8"
48-
color-eyre = { version = "0.1", default-features = false }
48+
color-eyre = { version = "0.2", default-features = false }
4949
```
5050

5151
## Example

src/help.rs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,14 @@ where
175175
}
176176
}
177177

178-
pub enum HelpInfo {
178+
pub(crate) enum HelpInfo {
179179
Note(Box<dyn Display + Send + Sync + 'static>),
180180
Warning(Box<dyn Display + Send + Sync + 'static>),
181181
Suggestion(Box<dyn Display + Send + Sync + 'static>),
182182
}
183183

184184
impl Display for HelpInfo {
185-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
185+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
186186
match self {
187187
Self::Note(context) => write!(f, "{}: {}", Cyan.paint("Note"), context),
188188
Self::Warning(context) => write!(f, "{}: {}", Yellow.paint("Warning"), context),
@@ -191,6 +191,25 @@ impl Display for HelpInfo {
191191
}
192192
}
193193

194+
impl fmt::Debug for HelpInfo {
195+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
196+
match self {
197+
Self::Note(context) => f
198+
.debug_tuple("Note")
199+
.field(&format_args!("{}", context))
200+
.finish(),
201+
Self::Warning(context) => f
202+
.debug_tuple("Warning")
203+
.field(&format_args!("{}", context))
204+
.finish(),
205+
Self::Suggestion(context) => f
206+
.debug_tuple("Suggestion")
207+
.field(&format_args!("{}", context))
208+
.finish(),
209+
}
210+
}
211+
}
212+
194213
pub(crate) mod private {
195214
use crate::Report;
196215
pub trait Sealed {}

src/lib.rs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! ```toml
99
//! [dependencies]
1010
//! eyre = "0.3.8"
11-
//! color-eyre = "0.1"
11+
//! color-eyre = "0.2"
1212
//! ```
1313
//!
1414
//! And then import the type alias from color-eyre for [`eyre::Report`] or [`eyre::Result`].
@@ -32,7 +32,7 @@
3232
//! ```toml
3333
//! [dependencies]
3434
//! eyre = "0.3.8"
35-
//! color-eyre = { version = "0.1", default-features = false }
35+
//! color-eyre = { version = "0.2", default-features = false }
3636
//! ```
3737
//!
3838
//! ## Example
@@ -119,6 +119,30 @@
119119
//! [`Help`]: trait.Help.html
120120
//! [`eyre::Report`]: https://docs.rs/eyre/0.3.8/eyre/struct.Report.html
121121
//! [`eyre::Result`]: https://docs.rs/eyre/0.3.8/eyre/type.Result.html
122+
#![doc(html_root_url = "https://docs.rs/color-eyre/0.2.0")]
123+
#![warn(
124+
missing_debug_implementations,
125+
missing_docs,
126+
missing_doc_code_examples,
127+
rust_2018_idioms,
128+
unreachable_pub,
129+
bad_style,
130+
const_err,
131+
dead_code,
132+
improper_ctypes,
133+
non_shorthand_field_patterns,
134+
no_mangle_generic_items,
135+
overflowing_literals,
136+
path_statements,
137+
patterns_in_fns_without_body,
138+
private_in_public,
139+
unconditional_recursion,
140+
unused,
141+
unused_allocation,
142+
unused_comparisons,
143+
unused_parens,
144+
while_true
145+
)]
122146
use ansi_term::Color::*;
123147
use backtrace::Backtrace;
124148
use eyre::*;
@@ -143,6 +167,7 @@ mod help;
143167
/// [`tracing-error`]: https://docs.rs/tracing-error
144168
/// [`color_eyre::Report`]: type.Report.html
145169
/// [`color_eyre::Result`]: type.Result.html
170+
#[derive(Debug)]
146171
pub struct Context {
147172
backtrace: Option<Backtrace>,
148173
#[cfg(feature = "capture-spantrace")]

0 commit comments

Comments
 (0)