parse_summary

Function parse_summary 

Source
pub fn parse_summary(summary: &str) -> Result<ConventionalCommit, ParseError>
Expand description

Parse a commit summary of the following form : <type>[optional scope]: <description> Returns a ConventionalCommit struct with a None body and empty footers.

ยงExample :


use conventional_commit_parser::parse_summary;
use conventional_commit_parser::commit::*;

let message = "feat(parser): implement parse_summary";

let parsed = parse_summary(message).expect("Parse error");

assert_eq!(parsed, ConventionalCommit {
    commit_type: CommitType::Feature,
    scope: Some("parser".to_string()),
    summary: "implement parse_summary".to_string(),
    body: None,
    footers: vec![],
    is_breaking_change: false
});