makepad_shader_compiler/util.rs
1use std::fmt;
2
3pub struct CommaSep<'a, T>(pub &'a [T]);
4
5impl<'a, T> fmt::Display for CommaSep<'a, T>
6where
7 T: fmt::Display,
8{
9 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10 let mut sep = "";
11 for item in self.0 {
12 write!(f, "{}{}", sep, item)?;
13 sep = ", ";
14 }
15 Ok(())
16 }
17}
18