-
Notifications
You must be signed in to change notification settings - Fork 62
Implementing an Iterator for the Attributes struct #26
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
Implementing an Iterator for the Attributes struct #26
Conversation
when you commit, you need to signoff commits with |
So now we need the same for attributes struct in v03 |
Also, every time you commit, don't forget to run |
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> Co-authored-by: Fabrizio Lazzaretti <fabrizio@lazzaretti.me> Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Doug Davis <dug@us.ibm.com> Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Doug Davis <dug@us.ibm.com> Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
src/event/v10/attributes.rs
Outdated
|
||
#[test] | ||
fn iterator_test(){ | ||
let a = Attributes{ |
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.
declare as mut
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.
so even if I do declare as mut, when it gets passed to .into_iter(), it will get initialised to 0 each time, and wont move ahead!
That's good! Now you need to do the same on the v03 attributes |
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
* Added String variant to Data Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Started V0.3 work Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Reworked EventDeserializer trait Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Now event parsing works with v1 and changes Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Cargo fmt Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Reorganized test data Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Fixed serde for v03 Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Implemented spec version conversion Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * cargo fmt Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Resolved: 1. https://github.com/cloudevents/sdk-rust/pull/26/files#r409586754 2. https://github.com/cloudevents/sdk-rust/pull/26/files#r409585595 Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
a3d8295
to
d316616
Compare
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Resolved: 1. https://github.com/cloudevents/sdk-rust/pull/26/files#r409586754 2. https://github.com/cloudevents/sdk-rust/pull/26/files#r409585595 Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
a4d293d
to
16e3b10
Compare
You wrongly remove CONTRIBUTING and README in this pr |
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.
Please revert the removal of Contributing.md and readme.md with
git fetch upstream
git checkout upstream/master -- CONTRIBUTING.md
git checkout upstream/master -- README.md
(assuming you named this remote with upstream
)
Please revert also the |
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
0a468a5
to
f203e52
Compare
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.
Looks good overall, some minor changes needed
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
cc49c87
to
fd09bb8
Compare
Signed-off-by: Pranav Bhatt <adpranavb2000@gmail.com>
This pull request is meant to implement the Iterator trait on the Attributes struct. It returns an
Option<(&str, AttributeValue)>
value. The Iterator will skip over any None values encountered in the non-essential fields.