1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use crate::{FormatTokens, ItemStr, Java, Tokens};
pub struct BlockComment<T>(pub(super) T);
impl<T> FormatTokens<Java> for BlockComment<T>
where
T: IntoIterator,
T::Item: Into<ItemStr>,
{
fn format_tokens(self, tokens: &mut Tokens<Java>) {
let mut it = self.0.into_iter().peekable();
if it.peek().is_none() {
return;
}
tokens.push();
tokens.append(ItemStr::Static("/**"));
tokens.push();
for line in it {
tokens.spacing();
tokens.append(ItemStr::Static("*"));
tokens.spacing();
tokens.append(line.into());
tokens.push();
}
tokens.spacing();
tokens.append("*/");
}
}