fn fmt()

in reverie/src/backtrace/mod.rs [250:272]


    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        let thread_name = self.thread_name();
        let thread_name = thread_name.as_ref().map(String::as_str);
        let thread_name = thread_name.unwrap_or("<unknown name>");
        writeln!(
            f,
            "Stack trace for thread {} ({:?}):",
            self.thread_id, thread_name
        )?;

        for (i, frame) in self.frames.iter().enumerate() {
            if frame.locations.is_empty() {
                writeln!(f, "{:>4}: {}", i, frame)?;
            } else {
                writeln!(f, "{:>4}: {:#}", i, frame.frame)?;
                for location in &frame.locations {
                    writeln!(f, "             at {}", location)?;
                }
            }
        }

        Ok(())
    }