-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add DriverIterator
to iterate though the registered drivers
#513
Conversation
6286d74
to
fd3de15
Compare
assert_eq!(DriverManager::count(), DriverIterator::new().count()); | ||
assert_eq!(DriverManager::count(), DriverManager::all().count()); | ||
|
||
let drivers: HashSet<String> = DriverManager::all().map(|d| d.short_name()).collect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a little overkill, I'd just keep the count
test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking the same in the beginning, but repeating the same driver DriverManager::count()
times would pass the test. Although that's a very unlikely mistake, this feels like a complete test.
I'm personally happy enough with the current version. |
Co-authored-by: Laurențiu Nicola <[email protected]>
f137c7b
to
70083c6
Compare
In that case, it's fine. Someone can always use a filter themselves. I just thought having named methods might make it easier for the library users instead of having to navigate the metadata for specific driver capabilities. |
If we add those, they can use |
r? @metasim |
CHANGES.md
if knowledge of this change could be valuable to users.Fixes #512
I've done the simplest implementation for the first commit:
Which seems too simple, so I'm thinking of adding the ability to filter by metadata.
Which would be something like this:
If someone needs to filter by more complex conditions, they can use the filter directly in the iterator, but providing some options for vectors and rasters seems like a reasonable thing to do.
What do you think?