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

Function read

atomic-cli/tests/it/workspace_txn_routing_cb5b_test.rs:89–99  ·  view source on GitHub ↗
(relative: &str)

Source from the content-addressed store, hash-verified

87}
88
89fn read(relative: &str) -> String {
90 let contents = fs::read_to_string(manifest_dir().join(relative))
91 .unwrap_or_else(|error| panic!("cannot read {relative}: {error}"));
92 // Windows checkouts may use CRLF; strip the test module on either platform.
93 let contents = contents.replace("\r\n", "\n");
94 contents
95 .split("\n#[cfg(test)]\nmod tests")
96 .next()
97 .unwrap_or(&contents)
98 .to_string()
99}
100
101fn manifest_dir() -> PathBuf {
102 Path::new(env!("CARGO_MANIFEST_DIR")).to_path_buf()

Calls 3

manifest_dirFunction · 0.70
replaceMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected