Add caller location to context

This commit is contained in:
Michael Pfaff 2023-01-23 19:06:23 -05:00
commit 2a58f55943
No known key found for this signature in database
GPG key ID: CF402C4A012AA9D4

View file

@ -18,11 +18,13 @@ struct HowInner {
impl How {
#[must_use]
#[inline(never)]
#[track_caller]
pub fn new(context: impl IntoContext) -> Self {
Self(Box::new(HowInner {
classified: false,
context: {
let mut vec = Vec::with_capacity(4);
vec.push(format!("At {}", std::panic::Location::caller()).into_context());
vec.push(context.into_context());
vec
},