Refactor uses of file-id-parsing functions to ensure we honnor the Result type
This commit is contained in:
parent
3e94e1612f
commit
e93aa4ceae
1 changed files with 6 additions and 1 deletions
|
@ -60,7 +60,11 @@ impl StorageBackend {
|
||||||
for entry in globlist {
|
for entry in globlist {
|
||||||
if let Ok(path) = entry {
|
if let Ok(path) = entry {
|
||||||
debug!(" - File: {:?}", path);
|
debug!(" - File: {:?}", path);
|
||||||
v.push(from_pathbuf(&path));
|
if let Ok(id) = from_pathbuf(&path) {
|
||||||
|
v.push(id);
|
||||||
|
} else {
|
||||||
|
error!("Cannot parse ID from path: {:?}", path);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Entry is not a path
|
// Entry is not a path
|
||||||
}
|
}
|
||||||
|
@ -77,6 +81,7 @@ impl StorageBackend {
|
||||||
glob(&self.prefix_of_files_for_module(m)[..]).and_then(|globlist| {
|
glob(&self.prefix_of_files_for_module(m)[..]).and_then(|globlist| {
|
||||||
let v = globlist.filter_map(Result::ok)
|
let v = globlist.filter_map(Result::ok)
|
||||||
.map(|pbuf| from_pathbuf(&pbuf))
|
.map(|pbuf| from_pathbuf(&pbuf))
|
||||||
|
.filter_map(Result::ok)
|
||||||
.collect::<Vec<FileID>>()
|
.collect::<Vec<FileID>>()
|
||||||
.into_iter();
|
.into_iter();
|
||||||
Ok(v)
|
Ok(v)
|
||||||
|
|
Loading…
Reference in a new issue