Skip to content

Commit a9a465e

Browse files
authored
stun: simplify UnknownAttributes Display (#685)
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
1 parent 0037f1b commit a9a465e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

stun/src/uattrs.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ impl fmt::Display for UnknownAttributes {
1717
if self.0.is_empty() {
1818
write!(f, "<nil>")
1919
} else {
20-
let mut s = vec![];
21-
for t in &self.0 {
22-
s.push(t.to_string());
23-
}
24-
write!(f, "{}", s.join(", "))
20+
let s = self
21+
.0
22+
.iter()
23+
.map(|t| t.to_string())
24+
.collect::<Vec<_>>()
25+
.join(", ");
26+
write!(f, "{}", s)
2527
}
2628
}
2729
}

0 commit comments

Comments
 (0)