Skip to content

Commit 5484ee5

Browse files
authored
Avoid using collect_str in as_string mod (#47)
* Avoid using collect_str in as_string mod The reason is that some serializers (serde_json_wasm in our case) does not implement this function and raise not implemented panic. In future if we need no_std env we might need to change this. * Bump pyth-sdk version to 0.4.2 It's a minor change (or even a patch)
1 parent 70fa429 commit 5484ee5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pyth-sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-sdk"
3-
version = "0.4.1"
3+
version = "0.4.2"
44
authors = ["Pyth Data Foundation"]
55
edition = "2018"
66
license = "Apache-2.0"

pyth-sdk/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub mod as_string {
1616
T: std::fmt::Display,
1717
S: Serializer,
1818
{
19-
serializer.collect_str(value)
19+
serializer.serialize_str(value.to_string().as_str())
2020
}
2121

2222
pub fn deserialize<'de, T, D>(deserializer: D) -> Result<T, D::Error>

0 commit comments

Comments
 (0)