Skip to content

Commit

Permalink
fixed stable(alloc) check
Browse files Browse the repository at this point in the history
  • Loading branch information
salsabiljb committed Nov 11, 2024
1 parent 2cc0521 commit 3628919
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ use sentence::AisSentence;
use serde_json::Error as SerdeError;

/// Serializes an `AisSentence` to JSON
#[cfg(any(feature = "std", feature = "alloc"))]
use lib::std::string::String;
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

failed to resolve: use of undeclared crate or module std

Check failure

Code scanning / clippy

cannot find type String in this scope Error

cannot find type String in this scope
serde_json::to_string(sentence)
}

/// Deserializes an `AisSentence` from JSON
#[cfg(any(feature = "std", feature = "alloc"))]
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

failed to resolve: use of undeclared crate or module std
serde_json::from_str(json_data)
}
Expand Down

0 comments on commit 3628919

Please sign in to comment.