diff --git a/src/editor/commands/fetch.rs b/src/editor/commands/fetch.rs index 07695f1..8bf667c 100644 --- a/src/editor/commands/fetch.rs +++ b/src/editor/commands/fetch.rs @@ -15,15 +15,9 @@ pub fn fetch( ) { let handles = handles.flat_map(|handle| { if handles_are_files { - match std::fs::File::open(&handle) { + match std::fs::read_to_string(&handle) { Ok(file) => { - let mut file = BufReader::new(file); - let mut handles = vec![]; - let mut buf = String::new(); - while file.read_line(&mut buf).is_ok() { - handles.push(buf); - buf = String::new(); - } + let handles = file.lines().map(str::to_string).collect::>(); info!("Read {} handles from {handle}", handles.len()); handles }