-
Notifications
You must be signed in to change notification settings - Fork 5
Split gRPC converter into multiple files and remove convert_* functions #559
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
Conversation
Move BGP functions to their own file. Also eliminate redundant convert_ functions and just use TryFrom. Signed-off-by: Manish Vachharajani <[email protected]>
Display was being used for CLI output. This creates a wrapper for that use case and implements a FromStr and Display that do the short form (so FromStr can parse Display) Signed-off-by: Manish Vachharajani <[email protected]>
This commit also uses a checked type for interface addresses Signed-off-by: Manish Vachharajani <[email protected]>
Signed-off-by: Manish Vachharajani <[email protected]>
Signed-off-by: Manish Vachharajani <[email protected]>
Signed-off-by: Manish Vachharajani <[email protected]>
Signed-off-by: Manish Vachharajani <[email protected]>
Signed-off-by: Manish Vachharajani <[email protected]>
Signed-off-by: Manish Vachharajani <[email protected]>
Signed-off-by: Manish Vachharajani <[email protected]>
Signed-off-by: Manish Vachharajani <[email protected]>
3fead95
to
6645af7
Compare
Signed-off-by: Manish Vachharajani <[email protected]>
6645af7
to
b13e054
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.
Lots of things moving in this PR, I wish GitHub could show moving lines (diff.colorMoved
in Git). I assumed these commits where you move stuff around are only moving stuff around. Looks good to me
#[repr(transparent)] | ||
pub struct RenderInterfaceAddress<'a>(pub &'a InterfaceAddress); | ||
|
||
impl<'a> Display for RenderInterfaceAddress<'a> { |
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.
Why is this needed?
InvalidMaskLength(String), | ||
} | ||
|
||
impl FromStr for InterfaceAddress { |
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.
Also, why is this needed for?
This PR:
convert_*
functions in favor ofTryFrom
InterfaceAddress
typesPrefix
is not the same asInterfaceAddress
even though both look like<ip addr>/<mask>
as Prefix zeros the low order bits,InterfaceAddress
does not. It may be the case that we should error parsing aPrefix
that does not already have the low order bits as 0 and error if theInterfaceAddress
does have the low order bits as 0 (except for /31 and /127 masks) but I do not do that now as to limit the blast radius these changes.Fixes #549