Open
Conversation
Ayrx
reviewed
Mar 29, 2024
Owner
Ayrx
left a comment
There was a problem hiding this comment.
Thanks for the PR! I've left some quick comments.
tests/test.xml
Outdated
| <debugging level="0"/> | ||
| <host starttime="1588318812" endtime="1588318814"><status state="up" reason="echo-reply" reason_ttl="53"/> | ||
| <address addr="45.33.32.156" addrtype="ipv4"/> | ||
| <address addr="45.33.32.156" addrtype="ipv4" vendor="VMware"/> |
Owner
There was a problem hiding this comment.
This is very clearly wrong as addrtype="ipv4". tests/issue_1.xml has a valid example of a addrtype="mac".
src/host.rs
Outdated
|
|
||
| let vendor = node | ||
| .attribute("vendor") | ||
| .unwrap_or_default(); |
Owner
There was a problem hiding this comment.
I don't like this approach. If the vendor field is always present, we should just use .expect() here with the expectation that it should never fail. If the vendor field is option, it should be an Option<String>.
Author
Owner
There was a problem hiding this comment.
In that case, Option<String> is the perfect type for that.
Author
There was a problem hiding this comment.
In that case,
Option<String>is the perfect type for that.
Ok thanks, i'll try to fix it.. :)
Author
|
Thanks for reply!!!!! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Hi, I needed to read the network card vendor of the devices contacted, I saw that you didn't add it in your code, I did it.. it's my first PR, let me know..
Thank you!!
Riccardo