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
use std::fmt::{Display, Formatter};

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

impl DocComments {
    pub fn wrap(this: Option<String>) -> Option<Self> {
        this.map(|text| Self(format!("/**\n{text}\n*/\n")))
    }
}

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