MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / read_input_bytes

Function read_input_bytes

crates/cli/src/load.rs:91–99  ·  view source on GitHub ↗
(input: &str)

Source from the content-addressed store, hash-verified

89}
90
91fn read_input_bytes(input: &str) -> Result<Vec<u8>> {
92 if input == "-" {
93 let mut bytes = Vec::new();
94 std::io::stdin().read_to_end(&mut bytes).context("failed to read stdin")?;
95 return Ok(bytes);
96 }
97
98 std::fs::read(input).with_context(|| format!("failed to read input `{input}`"))
99}
100
101fn has_extension(path: &str, extension: &str) -> bool {
102 Path::new(path).extension().and_then(OsStr::to_str) == Some(extension)

Callers 1

load_moduleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected