Skip to content

Commit 033d0ba

Browse files
committed
Add comments.
1 parent 1c7ea30 commit 033d0ba

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

svg_fmt/src/svg.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,22 @@ impl Text {
500500
}
501501
}
502502

503+
pub struct Comment {
504+
pub text: String,
505+
}
506+
507+
pub fn comment<T: Into<String>>(text: T) -> Comment {
508+
Comment {
509+
text: text.into()
510+
}
511+
}
512+
513+
impl fmt::Display for Comment {
514+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
515+
write!(f, "<!-- {} -->", self.text)
516+
}
517+
}
518+
503519
/// `text-align:{self}`
504520
#[derive(Copy, Clone, PartialEq)]
505521
pub enum Align {

0 commit comments

Comments
 (0)