stak_profiler/
reverse.rs

1use crate::{Error, StackedRecord};
2
3/// Reverses stack frames in profile records.
4pub fn reverse_stacks<R: StackedRecord>(
5    records: impl IntoIterator<Item = Result<R, Error>>,
6) -> impl IntoIterator<Item = Result<R, Error>> {
7    records.into_iter().map(|record| {
8        record.map(|mut record| {
9            record.stack_mut().reverse_frames();
10            record
11        })
12    })
13}