-
Notifications
You must be signed in to change notification settings - Fork 0
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
Move protocol module to separate crate in workspace #6
Conversation
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.
Clean diff, well done
@@ -26,7 +26,7 @@ pub struct HeaderInfo { | |||
|
|||
impl HeaderInfo { | |||
/// Size of a full TACACS+ packet header. | |||
pub(in crate::protocol) const HEADER_SIZE_BYTES: usize = 12; | |||
pub const HEADER_SIZE_BYTES: usize = 12; |
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 used to be pub(in crate::protocol)
pub const HEADER_SIZE_BYTES: usize = 12; | |
pub(crate) const HEADER_SIZE_BYTES: usize = 12; |
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.
When working on the actual client, I ended up changing it to pub(crate)
since I used it when reading a packet from a connection, which is why I made it fully pub here (since they will technically be different crates now). I'm fine leaving it as pub(crate) here but I'll likely change anyways once the initial client stuff is merged.
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.
you can keep it as pub if you want, interested to see where this was needed in the client, seems more like a protocol matter
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
This is mainly due to Cargo not supporting optional dev-dependencies, which is inconvenient if we want to have client-specific (std-only) dev dependencies while having it in the same crate. It does make sense to break it out regardless though since I imagine packet (de)serialization can be useful even without a client.
Everything was basically directly moved over, with some imports changed here and there for correctness.