MCPcopy Create free account
hub / github.com/hashintel/hash / remove_builtin_frames

Function remove_builtin_frames

libs/error-stack/tests/common.rs:255–268  ·  view source on GitHub ↗
(report: &Report<E>)

Source from the content-addressed store, hash-verified

253}
254
255pub fn remove_builtin_frames<E>(report: &Report<E>) -> impl Iterator<Item = &Frame> {
256 report.frames().filter(|frame| {
257 #[cfg(feature = "backtrace")]
258 if frame.type_id() == TypeId::of::<Backtrace>() {
259 return false;
260 }
261 #[cfg(feature = "spantrace")]
262 if frame.type_id() == TypeId::of::<SpanTrace>() {
263 return false;
264 }
265
266 frame.type_id() != TypeId::of::<Location>()
267 })
268}
269
270/// Conditionally add two new frames to the count, as these are backtrace and spantrace.
271#[cfg_attr(

Callers 1

frame_kindsFunction · 0.85

Calls 3

framesMethod · 0.80
filterMethod · 0.45
type_idMethod · 0.45

Tested by

no test coverage detected