fn parse_commit_message(f: File) -> GitResult<Option<String>> {
    // This could enforce some stricter rules
    let reader = BufReader::new(f);
    let mut message: String = String::new();
    let mut has_content = false;
    for line_res in reader.lines() {
        let line = line_res?;
        if line.get(0..1) == Some("#") {
            continue;
        }
        if line.len() > 0 {
            has_content = true;
        }
        message.push_str(&line);
        message.push('\n');
    }
    Ok(match has_content {
        true => Some(message),
        false => None,
    })
}
// Read and parse a commit edit message file
Read and parse a commit edit message file
Read and parse a commit edit message file
fn parse_commit_message(f: File) -> GitResult<Option<String>> {
    // This could enforce some stricter rules
    let reader = BufReader::new(f);
    let mut message: String = String::new();
    let mut has_content = false;
    for line_res in reader.lines() {
        let line = line_res?;
        if line.get(0..1) == Some("#") {
            continue;
        }
        if line.len() > 0 {
            has_content = true;
        }
        message.push_str(&line);
        message.push('\n');
    }
    Ok(match has_content {
        true => Some(message),
        false => None,
    })
}
fn parse_commit_message ( f : File ) -> GitResult < Option < String > > { // This could enforce some stricter rules let reader = BufReader :: new ( f ) ; let mut message : String = String :: new ( ) ; let mut has_content = false ; for line_res in reader . lines ( ) { let line = line_res ? ; if line . get ( 0 .. 1 ) == Some ( " " ) { continue ; } if line . len ( ) > 0 { has_content = true ; } message . push_str ( & line ) ; message . push ( '\n' ) ; } Ok ( match has_content { true => Some ( message ) , false => None , } ) }
Read and parse a commit edit message file
Read and parse a commit edit message file
f
File
f
File