pythonic 0.3.0

pythonic is a Rust AST builder that generates Python
Documentation
use std::fmt::{Display, Formatter, Result};

#[derive(Debug, Clone)]
pub struct Comment {
    pub comment: String,
    pub docstring: bool,
}

impl Comment {
    pub fn new<T: Display>(comment: T) -> Comment {
        Comment {
            comment: comment.to_string(),
            docstring: false,
        }
    }

    pub fn docstring<T: Display>(comment: T) -> Comment {
        Comment {
            comment: comment.to_string(),
            docstring: true,
        }
    }
}

impl Display for Comment {
    fn fmt(&self, f: &mut Formatter) -> Result {
        let comment_len = if self.docstring {
            ""
        } else {
            "// "
        };

        write!(f, "{}{}", comment_len, self.comment)
    }
}