fastgrep 0.1.7

Fast parallel grep with SIMD-accelerated search and trigram indexing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::process::Command;

fn main() {
    let sha = Command::new("git")
        .args(["rev-parse", "--short", "HEAD"])
        .output()
        .ok()
        .filter(|o| o.status.success())
        .and_then(|o| String::from_utf8(o.stdout).ok())
        .map(|s| s.trim().to_string())
        .unwrap_or_default();

    let version_suffix = if sha.is_empty() { String::from("release") } else { sha };

    println!("cargo:rustc-env=GIT_SHA={version_suffix}");
}