INNER CODE UNIT · Rust

set_build_identity

logannye/rosalind · crates/receipt/src/lib.rs:79

pub fn set_build_identity(identity: BuildIdentity) {
    let _ = BUILD_IDENTITY.set(identity);
}

/// The five claim key/value pairs for the installed identity, or `"unknown"` if unset.
fn build_identity_pairs() -> [(&'static str, String); 5] {
    match BUILD_IDENTITY.get() {
        Some(i) => [
            ("code_git_sha", i.code_git_sha.clone()),
            ("code_dirty", i.code_dirty.clone()),
            ("rustc_version", i.rustc_version.clone()),
            ("target_triple", i.target_triple.clone()),
            ("deps_lock_blake3", i.deps_lock_blake3.clone()),
        ],
        None => {
            let u = || "unknown".to_string();
            [
                ("code_git_sha", u()),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…