Skip to content

Commit

Permalink
rust 1.80 ci fixes (#568)
Browse files Browse the repository at this point in the history
This fixes CI for rust 1.80.

This effectively adds support for backtrace which came in rust 1.65
(MSRV is currently 1.70).
  • Loading branch information
baloo authored Jan 17, 2025
1 parent b5ae19f commit 12b25dd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Error types
use std::{
backtrace::Backtrace,
fmt::{self, Debug, Display},
ops::Deref,
};
Expand Down Expand Up @@ -59,7 +60,6 @@ where
source: Option<BoxError>,

/// Backtrace where error occurred
#[cfg(feature = "backtrace")]
backtrace: Option<Backtrace>,
}

Expand All @@ -72,8 +72,7 @@ where
Context {
kind,
source,
#[cfg(feature = "backtrace")]
backtrace: Some(Backtrace::new()),
backtrace: Some(Backtrace::capture()),
}
}

Expand All @@ -83,7 +82,6 @@ where
}

/// Get the backtrace associated with this error (if available)
#[cfg(feature = "backtrace")]
pub fn backtrace(&self) -> Option<&Backtrace> {
self.backtrace.as_ref()
}
Expand Down

0 comments on commit 12b25dd

Please sign in to comment.