gccrs-tools 0.2.0

Various tools and modules to help develop gccrs tooling and interact with the project
Documentation
pub enum Commit {
    NeedsPrefixing(String),
    Prefixed(String),
}

impl Commit {
    pub fn new(content: String) -> Commit {
        if content.starts_with("gccrs: ")
            || content.starts_with("rust: ")
            || content.starts_with("Rust: ")
        {
            Commit::Prefixed(content)
        } else {
            Commit::NeedsPrefixing(content)
        }
    }

    pub fn maybe_prefix(self) -> String {
        match self {
            Commit::NeedsPrefixing(content) => format!("gccrs: {content}"),
            Commit::Prefixed(content) => content,
        }
    }
}