gesha-rust-types 0.0.7

Rust types for Gesha proejct
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::fmt::{Display, Formatter};

/// https://doc.rust-lang.org/reference/comments.html#non-doc-comments
#[derive(Clone, Debug, PartialEq)]
pub struct NonDocComments(String);

impl NonDocComments {
    pub fn block(text: impl Into<String>) -> Self {
        let text = text.into();
        NonDocComments(format!("/*\n{text}\n*/\n"))
    }
}

impl Display for NonDocComments {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        Display::fmt(&self.0, f)
    }
}