-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add serde::Serialize support for AisMessage #25
base: main
Are you sure you want to change the base?
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.
clippy found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
use serde_json::Error as SerdeError; | ||
|
||
/// Serializes an `AisSentence` to JSON | ||
pub fn serialize_to_json(sentence: &AisSentence) -> std::result::Result<String, SerdeError> { |
Check failure
Code scanning / clippy
failed to resolve: use of undeclared crate or module std Error
use serde_json::Error as SerdeError; | ||
|
||
/// Serializes an `AisSentence` to JSON | ||
pub fn serialize_to_json(sentence: &AisSentence) -> std::result::Result<String, SerdeError> { |
Check failure
Code scanning / clippy
cannot find type String in this scope Error
} | ||
|
||
/// Deserializes an `AisSentence` from JSON | ||
pub fn deserialize_from_json(json_data: &str) -> std::result::Result<AisSentence, SerdeError> { |
Check failure
Code scanning / clippy
failed to resolve: use of undeclared crate or module std Error
84c1d75
to
2cc0521
Compare
* This enables serialization of AIS messages into JSON format.
*This provides a readable string representation for each AisMessage variant.