Skip to content

Commit

Permalink
refactor: Reduce reliance on soon-to-deprecate kind
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Feb 2, 2022
1 parent 3b516a4 commit 03832c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/parse/error.rs
Expand Up @@ -443,6 +443,8 @@ pub struct Error {

#[derive(Debug)]
struct ErrorInner {
/// The type of error
kind: ErrorKind,
/// Formatted error message, enhancing the cause message with extra information
message: Message,
source: Option<Box<dyn error::Error + Send + Sync>>,
Expand Down Expand Up @@ -475,7 +477,7 @@ impl Error {

/// Type of error for programmatic processing
pub fn kind(&self) -> ErrorKind {
self.kind
self.inner.kind
}

/// Should the message be written to `stdout` or not?
Expand Down Expand Up @@ -542,6 +544,7 @@ impl Error {
pub(crate) fn new(message: impl Into<Message>, kind: ErrorKind, wait_on_exit: bool) -> Self {
Self {
inner: Box::new(ErrorInner {
kind,
message: message.into(),
source: None,
wait_on_exit,
Expand Down

0 comments on commit 03832c7

Please sign in to comment.