cozodb / cozo

A transactional, relational-graph-vector database that uses Datalog for query. The hippocampus for AI!
https://cozodb.org
Mozilla Public License 2.0
3.44k stars 108 forks source link

Implement IntoIterator for NamedRows #206

Closed a-0-dev closed 1 year ago

a-0-dev commented 1 year ago

This is a tiny quality-of-life pull request for using NamedRows.

Before, one first had peel the rows member of NamedRows out of the struct to then call into_iter(), which is not necessary since the rows are the only reasonable thing to iterate through for a NamedRows object.

So, this PR implements the standard trait of IntoIterator for NamedRows directly, reducing something like rows.rows.into_iter() to rows.into_iter().

Since iterating through rows is very common when handling any query result, this would improve the readability and brevity of code significantly for me (and potentially others). If you have any questions, feel free to comment :)

github-actions[bot] commented 1 year ago

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


Philip (a-0) seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

a-0-dev commented 1 year ago

This is unfortunate, I will not disclose my mail address used for this GitHub account just to sign the CLA. I opened issue #207 instead.