MCPcopy Create free account
hub / github.com/alignoth/alignoth / write_files

Function write_files

src/main.rs:286–311  ·  view source on GitHub ↗
(
    spec_data: &[u8],
    ref_data: &[u8],
    read_data: &[u8],
    highlight_data: &[u8],
    coverage_data: &[u8],
    spec_path: &Path,
    ref_path: &Path,
    read_path: &Path,
    highlight_p

Source from the content-addressed store, hash-verified

284
285#[allow(clippy::too_many_arguments)]
286fn write_files(
287 spec_data: &[u8],
288 ref_data: &[u8],
289 read_data: &[u8],
290 highlight_data: &[u8],
291 coverage_data: &[u8],
292 spec_path: &Path,
293 ref_path: &Path,
294 read_path: &Path,
295 highlight_path: Option<PathBuf>,
296 coverage_path: &Path,
297) -> Result<()> {
298 let mut specs = File::create(spec_path).unwrap();
299 specs.write_all(spec_data)?;
300 let mut read_file = File::create(read_path).unwrap();
301 read_file.write_all(read_data)?;
302 let mut reference_file = File::create(ref_path).unwrap();
303 reference_file.write_all(ref_data)?;
304 let mut coverage_file = File::create(coverage_path).unwrap();
305 coverage_file.write_all(coverage_data)?;
306 if let Some(path) = highlight_path {
307 let mut highlight_file = File::create(path).unwrap();
308 highlight_file.write_all(highlight_data)?;
309 }
310 Ok(())
311}
312
313#[cfg(test)]
314mod tests {

Callers 2

mainFunction · 0.85
test_write_filesFunction · 0.85

Calls 1

OkFunction · 0.85

Tested by 1

test_write_filesFunction · 0.68