INNER CODE UNIT · Rust

files_json

logannye/rosalind · crates/receipt-wasm/src/lib.rs:281

fn files_json(files: &[rosalind_receipt::FileHash]) -> String {
    let body = files
        .iter()
        .map(|file| {
            format!(
                "{{\"path\":\"{}\",\"blake3\":\"{}\"}}",
                json_escape(&file.path),
                json_escape(&file.blake3)
            )
        })
        .collect::<Vec<_>>()
        .join(",");
    format!("[{body}]")
}

fn string_map_json(map: &std::collections::BTreeMap<String, String>) -> String {
    let body = map
        .iter()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…