summaryrefslogtreecommitdiff
path: root/src/run.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/run.rs')
-rw-r--r--src/run.rs15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/run.rs b/src/run.rs
index 5b1a790..183ce6b 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -1,13 +1,8 @@
-use std::{
- ffi::OsStr,
- io::{Read, Write},
- os::unix::ffi::OsStrExt,
- path::Path,
-};
+use std::io::{Read, Write};
use repo2markdown::{
fenced_md_generator::generate_fenced_markdown, logger::Logger,
- md_generator::generate_markdown_from_paths,
+ md_generator::generate_markdown_from_paths, path_list::paths_from_null_separated_bytes,
};
use crate::cli::Cli;
@@ -21,11 +16,7 @@ pub fn run<R: Read, W: Write>(
let mut input_buf = Vec::new();
input.read_to_end(&mut input_buf)?;
- let paths: Vec<&Path> = input_buf
- .split(|b| *b == 0)
- .filter(|bytes| !bytes.is_empty())
- .map(|bytes| Path::new(OsStr::from_bytes(bytes)))
- .collect();
+ let paths = paths_from_null_separated_bytes(&input_buf);
if cli.fenced {
generate_fenced_markdown(