Skip to content

Add ser_as_str feature to serialize using serialize_str()#52

Merged
krisprice merged 2 commits intokrisprice:masterfrom
elrafoon:ser_as_str
Oct 22, 2023
Merged

Add ser_as_str feature to serialize using serialize_str()#52
krisprice merged 2 commits intokrisprice:masterfrom
elrafoon:ser_as_str

Conversation

@elrafoon
Copy link
Copy Markdown
Contributor

I'm doing a lot of no_std firmware development, and frequently use serde_json_core crate.

This serializer does not support collect_str() used in ipnet's serialization code since 1096c55.

This patch adds new feature to enable serialization by formatting Ipv*Net addr to heapless::String and then serializing using serialize_str(). Since maximum formatted address length is fixed, and not too big, memory usage is still very low.

elrafoon and others added 2 commits October 11, 2023 18:09
Serializer may not support collect_str, as is the case with
serde_json_core crate.
@krisprice krisprice merged commit 585bcad into krisprice:master Oct 22, 2023
@krisprice
Copy link
Copy Markdown
Owner

Merged and published on crates.io, thanks @elrafoon

@elrafoon
Copy link
Copy Markdown
Contributor Author

Thanks!

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.

2 participants