Add caller location to context
This commit is contained in:
parent
bbc7df28d8
commit
2a58f55943
|
@ -18,11 +18,13 @@ struct HowInner {
|
||||||
impl How {
|
impl How {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
|
#[track_caller]
|
||||||
pub fn new(context: impl IntoContext) -> Self {
|
pub fn new(context: impl IntoContext) -> Self {
|
||||||
Self(Box::new(HowInner {
|
Self(Box::new(HowInner {
|
||||||
classified: false,
|
classified: false,
|
||||||
context: {
|
context: {
|
||||||
let mut vec = Vec::with_capacity(4);
|
let mut vec = Vec::with_capacity(4);
|
||||||
|
vec.push(format!("At {}", std::panic::Location::caller()).into_context());
|
||||||
vec.push(context.into_context());
|
vec.push(context.into_context());
|
||||||
vec
|
vec
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue