MCPcopy Create free account
hub / github.com/Notgnoshi/generative / get_input_reader

Function get_input_reader

generative/io/stdio.rs:15–23  ·  view source on GitHub ↗
(input: &Option<PathBuf>)

Source from the content-addressed store, hash-verified

13}
14
15pub fn get_input_reader(input: &Option<PathBuf>) -> eyre::Result<BufReader<Box<dyn Read>>> {
16 match input {
17 Some(path) => {
18 let file = File::open(path)?;
19 Ok(BufReader::new(Box::new(file)))
20 }
21 None => Ok(BufReader::new(Box::new(std::io::stdin()))),
22 }
23}

Callers 12

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected