-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing a closure for ArchiveIterator::filter #115
Conversation
Pull Request Test Coverage Report for Build 5093390276
💛 - Coveralls |
In testing, maybe the filter should unwrap the filename?! diff --git a/tests/integration_test.rs b/tests/integration_test.rs
index 55eb140..bacc143 100644
--- a/tests/integration_test.rs
+++ b/tests/integration_test.rs
@@ -731,11 +731,11 @@ fn decode_chinese_zip() {
#[test]
fn iterate_archive_with_filter_name() {
let source = std::fs::File::open("tests/fixtures/tree.tar").unwrap();
- let expected_name = Some(OsStr::new("leaf"));
+ let expected_name = OsStr::new("leaf");
let mut entries = Vec::new();
for content in ArchiveIteratorBuilder::new(source)
- .filter(move |name, _stat| Path::new(name).file_name() == expected_name)
+ .filter(move |name, _stat| Path::new(name).file_name().unwrap() == expected_name)
.build()
.unwrap()
{ But the PR looks perfect! |
Fixes: #114. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
I prefer to avoid |
Pull Request Test Coverage Report for Build 5093390276Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 5091551968Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Fixes: #114.
Signed-off-by: Otavio Salvador otavio@ossystems.com.br