v2 #2
1 changed files with 1 additions and 1 deletions
commit
95e0187f5e
|
|
@ -3,7 +3,7 @@ use std::{ffi::OsString, path::PathBuf, str::FromStr, string::FromUtf8Error};
|
||||||
fn paths_parser(input: OsString) -> Result<Vec<PathBuf>, FromUtf8Error> {
|
fn paths_parser(input: OsString) -> Result<Vec<PathBuf>, FromUtf8Error> {
|
||||||
let input = String::from_utf8(input.into_encoded_bytes())?;
|
let input = String::from_utf8(input.into_encoded_bytes())?;
|
||||||
let mut paths = Vec::new();
|
let mut paths = Vec::new();
|
||||||
for path in input.split('\n') {
|
for path in input.split('\n').filter(|s| !s.is_empty()) {
|
||||||
paths.push(match PathBuf::from_str(path) {
|
paths.push(match PathBuf::from_str(path) {
|
||||||
Ok(ok) => ok,
|
Ok(ok) => ok,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue