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

Function input

atomic-cli/src/commands/review/incremental.rs:53–67  ·  view source on GitHub ↗
(path: Option<&Path>, limit: usize)

Source from the content-addressed store, hash-verified

51}
52
53pub(super) fn input(path: Option<&Path>, limit: usize) -> CliResult<Option<Vec<u8>>> {
54 path.map(|path| {
55 let mut bytes = Vec::new();
56 std::fs::File::open(path)?
57 .take((limit + 1) as u64)
58 .read_to_end(&mut bytes)?;
59 if bytes.len() > limit {
60 return Err(CliError::InvalidArgument {
61 message: format!("{} exceeds {} bytes", path.display(), limit),
62 });
63 }
64 Ok(bytes)
65 })
66 .transpose()
67}
68
69pub(super) fn request(args: &IncrementalArgs) -> CliResult<ReviewRequest> {
70 let session_id = if args.view.is_none() && args.from.is_none() && args.to.is_none() {

Callers 2

runFunction · 0.70
requestFunction · 0.70

Calls 2

openFunction · 0.50
lenMethod · 0.45

Tested by

no test coverage detected