Skip to content

Commit

Permalink
fix: restore #[no_std] attribute for no_std compatibility (#171)
Browse files Browse the repository at this point in the history
* fix: restore #[no_std] attribute

* fix: clippy v0.1.75 catches

* chore: add unclog
  • Loading branch information
Farhad-Shabani authored Jan 5, 2024
1 parent bf9e413 commit 3cdd760
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix `#[no_std]` attribute removal and add `informalsystems-pbjson/std` dependency
for `std` feature ([#171](https://github.com/cosmos/ibc-proto-rs/issues/171)).
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ serde_json = "1.0.107"

[features]
default = ["std", "client"]
std = ["prost/std", "bytes/std", "subtle-encoding/std", "base64/std", "flex-error/std", "ics23/std"]
std = ["prost/std", "bytes/std", "subtle-encoding/std", "base64/std", "flex-error/std", "ics23/std", "informalsystems-pbjson/std"]
serde = ["dep:serde", "ics23/serde", "informalsystems-pbjson"]
client = ["std", "dep:tonic", "tonic/codegen", "tonic/transport", "tonic/prost"]
json-schema = ["std", "serde", "dep:schemars"]
Expand Down
7 changes: 2 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
// Todo: automate the creation of this module setup based on the dots in the filenames.
// This module setup is necessary because the generated code contains "super::" calls for dependencies.

#![cfg_attr(
not(feature = "serde"),
deny(warnings, trivial_casts, trivial_numeric_casts, unused_import_braces)
)]
#![cfg_attr(not(feature = "std"), no_std)]
#![deny(warnings, trivial_casts, trivial_numeric_casts, unused_import_braces)]
#![allow(clippy::large_enum_variant, clippy::derive_partial_eq_without_eq)]
#![allow(rustdoc::bare_urls)]
#![forbid(unsafe_code)]
Expand Down
2 changes: 1 addition & 1 deletion src/prost/google.protobuf.serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4828,7 +4828,7 @@ impl serde::Serialize for UninterpretedOption {
struct_ser.serialize_field("doubleValue", v)?;
}
if let Some(v) = self.string_value.as_ref() {
struct_ser.serialize_field("stringValue", pbjson::private::base64::encode(&v).as_str())?;
struct_ser.serialize_field("stringValue", pbjson::private::base64::encode(v).as_str())?;
}
if let Some(v) = self.aggregate_value.as_ref() {
struct_ser.serialize_field("aggregateValue", v)?;
Expand Down
2 changes: 1 addition & 1 deletion src/prost/ibc.core.channel.v1.serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl serde::Serialize for Acknowledgement {
if let Some(v) = self.response.as_ref() {
match v {
acknowledgement::Response::Result(v) => {
struct_ser.serialize_field("result", pbjson::private::base64::encode(&v).as_str())?;
struct_ser.serialize_field("result", pbjson::private::base64::encode(v).as_str())?;
}
acknowledgement::Response::Error(v) => {
struct_ser.serialize_field("error", v)?;
Expand Down

0 comments on commit 3cdd760

Please sign in to comment.