MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / with_writer

Function with_writer

atomic-core/src/output/repo/writer.rs:484–494  ·  view source on GitHub ↗

Helper to create a writer and run a test function, then return the buffer contents

(f: F)

Source from the content-addressed store, hash-verified

482
483 /// Helper to create a writer and run a test function, then return the buffer contents
484 fn with_writer<F>(f: F) -> Vec<u8>
485 where
486 F: FnOnce(&mut ConflictWriter<&mut Vec<u8>>),
487 {
488 let mut buffer = Vec::new();
489 {
490 let mut writer = ConflictWriter::new(&mut buffer, "test.rs", test_position());
491 f(&mut writer);
492 }
493 buffer
494 }
495
496 // ------------------------------------------------------------------------
497 // Constructor Tests

Callers 15

test_write_simpleFunction · 0.85
test_write_with_newlinesFunction · 0.85
test_begin_conflictFunction · 0.85
test_conflict_with_hashFunction · 0.85
test_take_conflictsFunction · 0.85
test_into_innerFunction · 0.85

Calls 1

test_positionFunction · 0.70

Tested by 15

test_write_simpleFunction · 0.68
test_write_with_newlinesFunction · 0.68
test_begin_conflictFunction · 0.68
test_conflict_with_hashFunction · 0.68
test_take_conflictsFunction · 0.68
test_into_innerFunction · 0.68