Skip to content

Conversation

@salsabiljb
Copy link
Contributor

  • Implemented serde::Serialize for the AisMessage enum and all its variants:
    * This enables serialization of AIS messages into JSON format.
  • Implemented the fmt::Display trait for AisMessage:
    *This provides a readable string representation for each AisMessage variant.

Copy link

@github-advanced-security github-advanced-security bot left a 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`

failed to resolve: use of undeclared crate or module `std`
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

cannot find type `String` in this scope
}

/// 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`

failed to resolve: use of undeclared crate or module `std`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant