1use core::fmt;
3
4pub static LOG_FILENAME_PREFIX: &str = "cranelift.dbg.";
6
7pub struct DisplayList<'a, T>(pub &'a [T])
9where
10 T: 'a + fmt::Display;
11
12impl<'a, T> fmt::Display for DisplayList<'a, T>
13where
14 T: 'a + fmt::Display,
15{
16 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17 match self.0.split_first() {
18 None => write!(f, "[]"),
19 Some((first, rest)) => {
20 write!(f, "[{first}")?;
21 for x in rest {
22 write!(f, ", {x}")?;
23 }
24 write!(f, "]")
25 }
26 }
27 }
28}